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.


syot kilat


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


syot kilat



syot kilat



syot kilat



🔵Function Outputs


chartcolorsdisplayformattingpinepinecodepinescriptstylethemethemestradingfinderutilities

Perpustakaan Pine

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai satu perpustakaan sumber terbuka supaya pengaturcara Pine lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau dalam penerbitan sumber terbuka lain, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman.


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/
Juga pada:

Penafian