Pine Script Transparent Color: A Quick Guide
Ever looked at a TradingView chart and thought "man, this is way too cluttered"? Yeah, me too. One thing that really helps clean things up is using transparent colors in your Pine Script indicators. It's like having multiple layers of tracing paper - you can see everything, but some stuff is just more subtle.

What's the deal with transparency anyway?​
So here's the thing - colors in Pine Script work with what's called RGB (red, green, blue). Each color gets a number from 0 to 255. But there's also this transparency thing, which goes from 0 to 100. Think of it like this:
- 0 = completely solid (you can't see through it at all)
- 100 = completely invisible (why would you even use this?)
- Somewhere in between = you can see through it, but it's still there
It's super handy when you want to show multiple things on your chart without everything fighting for attention.
How to actually do it​

Pine Script gives you two main ways to make transparent colors:
Option 1: color.new() - Take an existing color and make it see-through Option 2: color.rgb() - Build your own color from scratch with transparency
Making your charts less of a mess​
Look, I've been there. You add one indicator, then another, then maybe a few more, and suddenly your chart looks like someone threw a rainbow at it. Transparent colors are honestly a game-changer here.

The cool thing is you can layer stuff without it looking like a complete disaster. Your moving averages can sit nicely behind your price action, support and resistance levels can be subtle but visible, and everything just... works together better.
Here's a simple example with color.new​
//@version=5
indicator("My Transparent Line", overlay=true)
plot(close, color=color.new(color.red, 50)) // Red line that's 50% see-through
This just plots your closing price in red, but it's half transparent so it doesn't completely cover up whatever's behind it.
Building your own color with color.rgb​
//@version=5
indicator("Custom Color Fun", overlay=true)
myColor = color.rgb(66, 25, 45, 50) // Mix your own color with 50% transparency
plot(close, color=myColor)
This lets you get really specific with your colors. Those numbers (66, 25, 45) create a kind of burgundy color, and the 50 makes it half transparent.
Why bother with this stuff?​
Honestly? It just makes your charts way easier to look at. Here's what I've noticed:
- Less eye strain: When everything isn't screaming for attention, you can actually focus on what matters
- Better layering: You can stack multiple indicators without creating a visual nightmare
- Cleaner look: Your charts just look more professional (if that's your thing)
Some tips from someone who's made mistakes​
- Don't go crazy with 100% transparency - you literally won't see anything
- Sweet spot is usually between 20-60% transparency for background stuff
- If something's important, keep it more solid (lower transparency numbers)
- Let people adjust the transparency if you're sharing your script - everyone has different preferences
Wrapping up​
Transparent colors in Pine Script are one of those simple things that make a huge difference. Start playing around with color.new()
and color.rgb()
- you'll probably find your charts become way more readable.
And hey, if you come up with something cool or get stuck on something, drop a comment. Always happy to help out a fellow trader trying to make sense of the markets!