Available Color Constants
kScript provides 17 predefined color constants. These can be used directly in plotting functions and style definitions.
yellow
colorYellow color (#FFFF00)
orange
colorOrange color (#FFA500)
purple
colorPurple color (#800080)
gray
colorGray color (#808080)
black
colorBlack color (#000000)
white
colorWhite color (#FFFFFF)
red
colorRed color (#FF0000)
green
colorGreen color (#008000)
blue
colorBlue color (#0000FF)
silver
colorSilver color (#C0C0C0)
maroon
colorMaroon color (#800000)
fuchsia
colorFuchsia color (#FF00FF)
lime
colorLime color (#00FF00)
olive
colorOlive color (#808000)
navy
colorNavy color (#000080)
teal
colorTeal color (#008080)
aqua
colorAqua color (#00FFFF)
Using Colors in Your Scripts
Examples of how to use color constants in different plotting scenarios.
Single Color Plot
Use a single color constant for simple line plots.
Multi-Color Indicators
Combine multiple colors for complex multi-line indicators.
Recommended Color Palettes
Pre-designed color combinations that work well together for different types of indicators.
Trading Signals
Classic colors for buy/sell signals and trend indicators
var colors = ["green", "red", "blue"];
Technical Analysis
Professional colors for technical indicators and overlays
var colors = ["orange", "purple", "teal"];
Volume Analysis
Distinct colors for volume-based indicators
var colors = ["lime", "yellow", "fuchsia"];
Color Best Practices
Consistent Branding
Use the same color scheme across related indicators for visual consistency.
Accessibility
Choose colors with sufficient contrast for better readability.
Semantic Colors
Use meaningful colors: green for bullish, red for bearish.