ChaosPro Home
Introduction
What's New
Palettes
Using Formulas
Layering in ChaosPro
Rendering
Fractal Parameter Windows
Windows
Menu
3D Transformations
Animations
Formula Compiler
Writing Formulas
Language Reference
Introduction
Basic Syntax
Datatypes
bool
int
real-double-float
complex
vector
quaternion
color
array
NULL
Constants
Variables
Expressions
Operators
Functions
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Datatype color

A color consists of four floating point numbers: It contains the red, green and blue parts of a color. The fourth component is used to store the opacity (alpha value) of the color.
There is no "color constant" in ChaosPro: In order to create and assign colors you can use one of several functions which return colors:

  • rgb - lets you create a color by specifying the red, green and blue part.
  • rgba - lets you create a color by specifying the red, green, blue and alpha part.
  • hsl - lets you create a color by specifying its hue, saturation and luminance
  • hsla - lets you create a color by specifying its hue, saturation, luminance and alpha
  • gradient - lets you extract a color from the current gradient, i.e. the color path defined by the current palette.

Examples

color c1,c2;

  c1 = rgb(0.3,1.0,0.3); // Assigns a color to c1
  c2 = gradient(0.3);    // Extracts the color at position 0.3 from the current gradient

Colors are internally stored as four floating point numbers which use the 32 bit IEEE single precision format.