PINE LIBRARY

Dark & Light Theme [TradingFinder] Switching Colors Library

🔵Introduction

One of the challenges of script users is matching the colors used in indicators or strategies. By default, colors are chosen to display based on either the dark theme or the light theme.

In scripts with a large number of colors used, changing all colors to better display in dark mode or light mode can be a difficult and tedious process.

This library provides developers with the ability to adjust the colors used in their scripts based on the theme of the display.

🔵Logic

To categorize the color spectrum, the range from 0 to 255 of all three main colors red, green and blue was divided into smaller ranges.

Blue color, which is more effective in darkening or lightening colors, is divided into 8 categories, red color into 5 categories, and green color into 3 categories, because it has little effect on darkening or brightening colors.

The combination of these categories creates 120 different modes for the color range, which leads to a more accurate identification of the color and its brightness, and helps to decide how to change it.

Except for these 120 modes, there are 2 other modes that are related to colors almost white or black, which makes a total of 122 modes.


快照


🔵How to Use

First, you can add the library to your code as shown in the example below.




🟣Parameters



Color: In this parameter, enter the color you want to adjust based on light mode and dark mode.

Mode: Three modes "Off", "Light" and "Dark" are included in this parameter. "Light" mode is for color adjustment for use in "Light Mode".

"Dark" mode is for color adjustment for use in "Dark Mode" and "Off" mode turns off the color adjustment function and the input color to the function is the same as the output color.


快照



快照



快照



🔵Function Outputs


chartcolorsdisplayformattingpinepinecodepinescriptstylethemethemestradingfinderutilities

Pine腳本庫

在真正的TradingView精神中,作者將這段Pine程式碼發佈為開源程式庫,以便我們社群的其他Pine程式設計師可以重複使用它。請向作者致敬!您可以私下使用這個函式庫,或在其他開源出版品中使用,但在出版物中再次使用這段程式碼將受到網站規則的約束。


Get Access to TradingFinder indicators and Education for FREE: tradingFinder.com/

Forex, Crypto, Stocks, Futures & Index informational materials and Trading Tools in Turkish language: tradingFinder.com/tr/
更多:

免責聲明