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

ไลบรารีไพน์

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนได้เผยแพร่ Pine code นี้เป็นโอเพนซอร์ซไลบรารีเพื่อให้ 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/
และใน:

คำจำกัดสิทธิ์ความรับผิดชอบ