# How to retrieve default colors for plots?

#### kfmfe04

##### New member
Code:
``````def Y1High = Highest(High,252);

plot h = Y1High;
plot h9 = 0.9 * Y1High;
plot h8 = 0.8 * Y1High;
plot h7 = 0.7 * Y1High;
plot h6 = 0.6 * Y1High;
plot h5 = 0.5 * Y1High;
plot h4 = 0.4 * Y1High;``````

Used as a study, this code draws 7 lines using standard colors somewhere in ThinkScript.

How do I retrieve these colors so I can use them with
Code:
``addlabel(1, "52W High", colorForH);``

Solution
Code:
``````def Y1High = Highest(High,252);

plot h = Y1High;
plot h9 = 0.9 * Y1High;
plot h8 = 0.8 * Y1High;
plot h7 = 0.7 * Y1High;
plot h6 = 0.6 * Y1High;
plot h5 = 0.5 * Y1High;
plot h4 = 0.4 * Y1High;``````

Used as a study, this code draws 7 lines using standard colors somewhere in ThinkScript.

How do I retrieve these colors so I can use them with
Code:
``addlabel(1, "52W High", colorForH);``

One option is to use takevaluecolor()

Code:
``addlabel(1, "52W High", h.takevalueColor());``
Code:
``````def Y1High = Highest(High,252);

plot h = Y1High;
plot h9 = 0.9 * Y1High;
plot h8 = 0.8 * Y1High;
plot h7 = 0.7 * Y1High;
plot h6 = 0.6 * Y1High;
plot h5 = 0.5 * Y1High;
plot h4 = 0.4 * Y1High;``````

Used as a study, this code draws 7 lines using standard colors somewhere in ThinkScript.

How do I retrieve these colors so I can use them with
Code:
``addlabel(1, "52W High", colorForH);``

One option is to use takevaluecolor()

Code:
``addlabel(1, "52W High", h.takevalueColor());``

• halcyonguy and kfmfe04

### Not the exact question you're looking for?

87k+ Posts
229 Online ## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?