Notice!
This is documentation for kScript v1.0, which may not include the latest features. For up-to-date documentation, see the latest version.

Overview

Brightness Control

Adjust color brightness and luminosity with darken/lighten functions for creating visual hierarchy and emphasis in your indicators.

• Brightness adjustment • Darken/lighten effects • Luminosity control

Transparency Effects

Control opacity and transparency levels to create subtle background effects, overlays, and layered visualizations without overwhelming the chart.

• Opacity control • Transparency levels • Layer effects

Functions Reference

brightness - adjust color brightness levels

brightness(color: color, amount: number): color

Parameters:

  • color (color) - Source color to modify
  • amount (number) - Brightness adjustment (0-100, where 50 is no change)

Returns:

color (color with adjusted brightness)

Code Example:

darken - reduce color brightness/lightness

darken(color: color, amount: number): color

Parameters:

  • color (color) - Source color to darken
  • amount (number) - Darkening amount (0-100, where 0 is no change, 100 is black)

Returns:

color (darkened color)

Code Example:

lighten - increase color brightness/lightness

lighten(color: color, amount: number): color

Parameters:

  • color (color) - Source color to lighten
  • amount (number) - Lightening amount (0-100, where 0 is no change, 100 is white)

Returns:

color (lightened color)

Code Example:

transparency - set color transparency level

transparency(color: color, amount: number): color

Parameters:

  • color (color) - Source color to modify
  • amount (number) - Transparency level (0-100, where 0 is opaque, 100 is transparent)

Returns:

color (color with specified transparency)

Code Example:

opacity - set color opacity level (inverse of transparency)

opacity(color: color, amount: number): color

Parameters:

  • color (color) - Source color to modify
  • amount (number) - Opacity level (0-100, where 0 is fully transparent, 100 is fully opaque)

Returns:

color (color with specified opacity)

Code Example:

blend - mix two colors together

blend(color1: color, color2: color, amount: number): color

Parameters:

  • color1 (color) - First color to blend
  • color2 (color) - Second color to blend
  • amount (number) - Blending ratio (0-1, where 0 = color1, 1 = color2, 0.5 = equal mix)

Returns:

color (blended color result)

Code Example:

Best Practices

🎨

Color Psychology

Use green for bullish signals, red for bearish, and neutral colors for informational data. Consistent color schemes improve user experience.

👁️

Accessibility

Consider color-blind users by ensuring sufficient contrast and using patterns or shapes in addition to color for important signals.

🔧

Function Selection

Use darken() for creating shadows/depth, lighten() for highlights, opacity() for layering effects, and transparency() for subtle backgrounds. Each serves different visual purposes.

📖
Introduction
Overview of kScript language
🚀
Quick Start
Get started with kScript basics
📋
Function Reference
Complete API reference guide
🔧
Core Concepts
Variables, data types & data sources
🔗
Script Definition
Defining inputs and metadata
TimeSeries Management
Working with time-aligned data
🎯
Utility Functions
Helper functions and calculations
📈
Moving Averages
SMA, EMA and trend-following indicators
📊
Oscillators
RSI, Stochastic and momentum indicators
📈
Trend Indicators
Trend direction and strength analysis
📉
Volume Indicators
Volume-based analysis tools
📦
Orderbook Functions
Market depth analysis tools
🎨
Plotting & Visualization
Chart rendering and styling
🌈
Color Functions
Color manipulation and styling
🏠
Go Home
Return to main landing page