Divooka Reference

Color

6 nodes

On this page 6

Brightness

Function

Adjusts a colour's dark, middle and bright tones: shadows lift the darks, highlights scale the brights, and midtones bend the curve between them.

Signature
Brightness -> Hdr Color Element
    color: Hdr Color Element
    shadows: Number
    midtones: Number
    highlights: Number
HdrColorElement Brightness(
    HdrColorElement color,
    double shadows = 0,
    double midtones = 0,
    double highlights = 0)

Parameters

nametypedefaultdescription
colorHdr Color Element—The colour.
shadowsNumber0Lifts dark tones toward white: 0 is unchanged, 1 makes black white.
midtonesNumber0Brightens middle tones when above 0, darkens them below.
highlightsNumber0Scales bright tones: 0 is unchanged, 1 doubles them.

Returns

ColorHdr Color Element
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Color
Package
GPU Kernels

Color From Values

Function

A colour from its red, green, blue and opacity, each from 0 to 1.

Signature
ColorFromValues -> Hdr Color Element
    red: Number
    green: Number
    blue: Number
    alpha: Number
HdrColorElement ColorFromValues(
    double red,
    double green,
    double blue,
    double alpha = 1)

Parameters

nametypedefaultdescription
redNumber—Red, from 0 to 1.
greenNumber—Green, from 0 to 1.
blueNumber—Blue, from 0 to 1.
alphaNumber1Opacity, from 0 to 1.

Returns

ColorHdr Color Element
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Color
Package
GPU Kernels

Color Ramp

Function

Maps a value onto a ramp of colours, any number of stops along it: between two stops the colour is blended from theirs, before the first stop it is the first stop's, and after the last it is the last stop's.

Signature
ColorRamp(value: Number, ramp: Text) -> Hdr Color Element
HdrColorElement ColorRamp(
    double value,
    string ramp = "0 #000000; 1 #FFFFFF")

Parameters

nametypedefaultdescription
valueNumber—The value.
rampText0 #000000; 1 #FFFFFFThe ramp, stop by stop, each a position and a colour: 0 #000000; 1 #FFFFFF is black at 0 to white at 1.

Returns

ColorHdr Color Element
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Color
Package
GPU Kernels

Grey

Function

A grey of a value: the value in red, green and blue, fully opaque.

Signature
Grey(value: Number) -> Hdr Color Element
HdrColorElement Grey(double value)

Parameters

nametypedefaultdescription
valueNumber—The grey level, from 0 for black to 1 for white.

Returns

ColorHdr Color Element
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Color
Package
GPU Kernels

HSL Adjustments

Function

Adjusts a colour's hue, saturation and lightness.

Signature
HslAdjustments -> Hdr Color Element
    color: Hdr Color Element
    shift: Number
    saturation: Number
    lightness: Number
HdrColorElement HslAdjustments(
    HdrColorElement color,
    double shift = 0,
    double saturation = 1,
    double lightness = 1)

Parameters

nametypedefaultdescription
colorHdr Color Element—The colour.
shiftNumber0How far round the colour wheel to turn the hue, in turns: 0.5 is the opposite colour.
saturationNumber1Multiplies the saturation: 0 is grey, 1 is unchanged.
lightnessNumber1Multiplies the lightness: 0 is black, 1 is unchanged.

Returns

ColorHdr Color Element
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Color
Package
GPU Kernels

Mix Colors

Function

Blends from one colour to another: 0 gives the first, 1 the second.

Signature
MixColors -> Hdr Color Element
    from: Hdr Color Element
    to: Hdr Color Element
    amount: Number
HdrColorElement MixColors(
    HdrColorElement from,
    HdrColorElement to,
    double amount)

Parameters

nametypedefaultdescription
fromHdr Color Element—The colour at 0.
toHdr Color Element—The colour at 1.
amountNumber—How far to blend, normally from 0 to 1.

Returns

ColorHdr Color Element
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Color
Package
GPU Kernels