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.


imagen


🔵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.


imagen



imagen



imagen



🔵Function Outputs


chartcolorsdisplayformattingpinepinecodepinescriptstylethemethemestradingfinderutilities

Biblioteca Pine

Siguiendo fielmente el espíritu TradingView, el autor ha publicado este código Pine como una biblioteca de código abierto, permitiendo que otros programadores de Pine en nuestra comunidad lo utilicen de nuevo. ¡Olé por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero tenga en cuenta que la reutilización de este código en una publicación se rige por las Normas internas.


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/
También en:

Exención de responsabilidad