Reference2 min read
Predefined color constants available in kScript for chart visualization and plotting. Use these named colors for consistent styling across your indicators.
Available Color Constants
kScript provides predefined color constants that can be used directly in plotting functions and style definitions.| Color | Hex Value | Usage |
|---|---|---|
yellow | #FFFF00 | Highlights, warnings |
orange | #FFA500 | Accent color, signals |
purple | #800080 | Secondary indicators |
gray | #808080 | Neutral, background |
black | #000000 | Text, borders |
white | #FFFFFF | Light themes, contrast |
red | #FF0000 | Bearish, sell signals |
green | #008000 | Bullish, buy signals |
blue | #0000FF | Primary indicators |
silver | #C0C0C0 | Subtle backgrounds |
maroon | #800000 | Dark red tones |
fuchsia | #FF00FF | Vibrant highlights |
lime | #00FF00 | Bright green |
olive | #808000 | Muted yellow-green |
navy | #000080 | Dark blue |
teal | #008080 | Blue-green |
aqua | #00FFFF | Bright cyan |
Using Colors in Your Scripts
Single Color Plot
Use a single color constant for simple line plots:Multi-Color Indicators
Combine multiple colors for complex multi-line indicators:Conditional Colors
Use color arrays withcolorIndex to change colors based on conditions:
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:Technical Analysis
Professional colors for technical indicators and overlays:Volume Analysis
Distinct colors for volume-based indicators:Best Practices
Consistent Branding
Use the same color scheme across related indicators for visual consistency.Accessibility
Choose colors with sufficient contrast for better readability. Avoid relying solely on color to convey information.Semantic Colors
Use meaningful colors that match user expectations:- Green for bullish signals, gains, positive values
- Red for bearish signals, losses, negative values
- Blue for neutral indicators and reference lines
- Orange/Yellow for warnings and attention-grabbing elements