Houdini 20.0 VEX

Color functions

On this page

Color conversions

ctransform

Transforms between color spaces.

vector  ctransform(string fromspace, string tospace, vector clr)

vector  ctransform(string tospace, vector clr)

hsvtorgb

Convert HSV color space into RGB color space.

vector  hsvtorgb(vector hsv)

vector  hsvtorgb(float hue, float sat, float val)

luminance

Compute the luminance of the RGB color specified by the parameters.

float  luminance(vector rgb)

float  luminance(vector4 rgb)

float  luminance(float r, float g, float b)

rgbtohsv

Convert RGB color space to HSV color space.

vector  rgbtohsv(vector rgb)

vector  rgbtohsv(float r, float g, float b)

rgbtoxyz

Convert a linear sRGB triplet to CIE XYZ tristimulus values.

vector  rgbtoxyz(vector rgb)

xyztorgb

Convert CIE XYZ tristimulus values to a linear sRGB triplet.

vector  xyztorgb(vector xyz)

Open Color IO

ocio_activedisplays

Returns the names of active displays supported in Open Color IO

string [] ocio_activedisplays()

ocio_activeviews

Returns the names of active views supported in Open Color IO

string [] ocio_activeviews()

ocio_import

Imports attributes from OpenColorIO spaces.

int  ocio_import(string space, string property, int &value)

int  ocio_import(string space, string property, vector &value)

int  ocio_import(string space, string property, string &value)

ocio_parsecolorspace

Parse the color space from a string

string  ocio_parsecolorspace(string input)

Use OCIO to detect the color space in an input string. The input string is typically a filename.

input

The string to scan for a color space string. This is typically an image filename that has the color space encoded in the name.

ocio_roles

Returns the names of roles supported in Open Color IO

string [] ocio_roles()

ocio_spaces

Returns the names of color spaces supported in Open Color IO.

string [] ocio_spaces()

ocio_transform

Transform colors using Open Color IO

vector  ocio_transform(string dest, vector clr)

vector  ocio_transform(string src, string dest, vector clr)

vector  ocio_transform(string src, string dest, string looks, vector clr)

Transform a three-component color into a new color space.

vector4  ocio_transform(string dest, vector4 clr)

vector4  ocio_transform(string src, string dest, vector4 clr)

vector4  ocio_transform(string src, string dest, string looks, vector4 clr)

Transform a four-component color into a new color space.

src

The name of the color space to transform from. If this is not given, the function assumes the space assigned to "data".

dest

The name of the color space to transform to.

looks

A comma separated list of color gradings (also known as “looks”).

clr

The color to transform.

ocio_transformview

Transform colors to a view using Open Color IO

vector  ocio_transformview(string src, string display, string view, vector clr)

Transform a three-component color into a new view.

vector4  ocio_transformview(string src, string display, string view, vector4 clr)

Transform a four-component color into a new view.

src

The name of the color space to transform from.

display

The name of the Display containing the desired View.

view

The View to use as the destination to transform to.

clr

The color to transform.

Utility functions

blackbody

Compute the color value of an incandescent black body.

vector  blackbody(float temperature, float luminance)

ctransform

Transforms between color spaces.

vector  ctransform(string fromspace, string tospace, vector clr)

vector  ctransform(string tospace, vector clr)

luminance

Compute the luminance of the RGB color specified by the parameters.

float  luminance(vector rgb)

float  luminance(vector4 rgb)

float  luminance(float r, float g, float b)

VEX

Language

Next steps

Reference