Original Red Green color in watchlist column


Category:
0
0

Does anybody know how to get in a Custom Column the same colors (Red and Green) used by ToS in the pre-coded columns (e.g. Net Change, %Change, etc.) –  see attached screenshot, both the Red and Green are different.

I also copy my code for one of the two Custom Column for your reference:

#Intraday change
def IDC = (close - close[1]) / close[1] - (open - close[1]) / close[1];
addLabel(yes, AsPercent(IDC), if IDC > 0 then color.GREEN else if IDC < 0 then color.DOWNTICK else color.WHITE);
Attachments:
Marked as spam
Posted by (Questions: 7, Answers: 9)
Asked on June 11, 2020 10:47 am
109 views
1
Private answer

Apple computers come with a built-in app called Digital Color Meter. If you have a monitor that produces accurate colors you can use this tool to identify the exact RGB values of the colors used for any element displayed on the screen, including the built-in columns of the watchlist. None of the standard colors provided by Thinkorswim language match those colors so you have to use the CreateColor() function to dial it in.

The text is extremely small on a 4k display so I was only able to arrive a close match to what is being used for the built-in watchlist columns. Seems to me this is one of those details that folks waste a lot of time trying to dial in. What productive value does this serve? So long as you can tell the red from the green I suggest chasing things like this is a complete waste of time. But I understand some folks are bored and need something to do with their time.

Here is some code that contains colors which closely match what is displayed in the built-in columns:

plot data = 100 * (close / close[1] - 1);
data.AssignValueColor(if data > 0 then CreateColor(0, 195, 49) else CreateColor(237, 87, 87));

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on June 11, 2020 2:30 pm
0
Thanks Pete as usual. You made me smile - What productive value does it serve? Zero...
( at June 11, 2020 2:44 pm)
0
Don't tell anyone I said this, but I only mentioned it because I am guilty of the very same thing. In the past. As a self employed individual I have to put up very strong barriers to ensure all of my time is spent in productive activities. It takes discipline. The mind loves to wander.
( at June 11, 2020 3:49 pm)