Available Color Constants
kScript provides 17 predefined color constants. These can be used directly in plotting functions and style definitions.
yellowcolorYellow color (#FFFF00)
orangecolorOrange color (#FFA500)
purplecolorPurple color (#800080)
graycolorGray color (#808080)
blackcolorBlack color (#000000)
whitecolorWhite color (#FFFFFF)
redcolorRed color (#FF0000)
greencolorGreen color (#008000)
bluecolorBlue color (#0000FF)
silvercolorSilver color (#C0C0C0)
marooncolorMaroon color (#800000)
fuchsiacolorFuchsia color (#FF00FF)
limecolorLime color (#00FF00)
olivecolorOlive color (#808000)
navycolorNavy color (#000080)
tealcolorTeal color (#008080)
aquacolorAqua 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.
Conditional Coloring
Change colors based on market conditions or signal strength.
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
let colors = ["green", "red", "blue"];Technical Analysis
Professional colors for technical indicators and overlays
let colors = ["orange", "purple", "teal"];Volume Analysis
Distinct colors for volume-based indicators
let 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.