Vuo  1.2.8
Classes | Macros | Functions

Description

A color, with component values specifying red, green, blue, and alpha (opacity).

Classes

struct  VuoColor
 A color, with component values specifying red, green, blue, and alpha (opacity). More...
 

Functions

VuoColor VuoColor_makeFromJson (json_object *js)
 
Decodes the JSON object js to create a new value. More...
 
json_objectVuoColor_getJson (const VuoColor value)
 Encodes value as a JSON object. More...
 
char * VuoColor_getShortSummary (const VuoColor value)
 Returns a short HTML representation of value. More...
 
char * VuoColor_getSummary (const VuoColor value)
 Returns a detailed HTML representation of value. More...
 
bool VuoColor_areEqual (const VuoColor a, const VuoColor b)
 Returns true if both colors have the same intensity and alpha values. More...
 
bool VuoColor_isLessThan (const VuoColor a, const VuoColor b)
 Returns true if a < b. More...
 
bool VuoColor_areEqualWithinTolerance (const VuoColor a, const VuoColor b, const float tolerance)
 Like VuoColor_areEqual(), but permits color channel values to differ by up to tolerance. More...
 
static VuoColor VuoColor_makeWithRGBA (VuoReal r, VuoReal g, VuoReal b, VuoReal a) __attribute__((const))
 Returns a VuoColor with the given red, green, blue, alpha. More...
 
static void VuoColor_getRGBA (VuoColor color, VuoReal *r, VuoReal *g, VuoReal *b, VuoReal *a)
 Gets the red, green, blue, alpha of a color. More...
 
static VuoColor VuoColor_premultiply (VuoColor c) __attribute__((const))
 Returns a VuoColor whose red, green, and blue values have been multiplied by its alpha. More...
 
VuoColor VuoColor_makeWithHSLA (VuoReal hue, VuoReal saturation, VuoReal luminosity, VuoReal alpha)
 Returns a VuoColor with the given hue, saturation, lightness, alpha. More...
 
void VuoColor_getHSLA (VuoColor color, VuoReal *h, VuoReal *s, VuoReal *l, VuoReal *a)
 Gets the hue, saturation, lightness, hue, alpha of a color. More...
 
VuoReal VuoColor_getLightness (VuoColor color)
 Returns the HSL lightness of the color, in the range [0,1]. More...
 
VuoColor VuoColor_makeWithCMYKA (VuoReal c, VuoReal m, VuoReal y, VuoReal k, VuoReal a)
 Creates a new VuoColor from CMYK values. More...
 
void VuoColor_getCMYKA (VuoColor color, VuoReal *c, VuoReal *m, VuoReal *y, VuoReal *k, VuoReal *a)
 Get the Cyan, Magenta, Yellow, Black, and Alpha values from a VuoColor. More...
 
VuoText VuoColor_getHex (VuoColor color, VuoBoolean includeAlpha)
 Returns a hex string (like #445566ff) representing the color. More...
 
VuoColor VuoColor_average (VuoList_VuoColor colors)
 Returns the weighted (by alpha) average of colors. More...
 
static VuoColor VuoColor_lerp (VuoColor a, VuoColor b, float t) __attribute__((const))
 Returns a linearly-interpolated value between a and b using time t (between 0 and 1). More...
 
VuoColor VuoColor_makeFromString (const char *str)
 Automatically generated function. More...
 
char * VuoColor_getString (const VuoColor value)
 Automatically generated function. More...
 
void VuoColor_retain (VuoColor value)
 Automatically generated function. More...
 
void VuoColor_release (VuoColor value)
 Automatically generated function. More...
 

Class Documentation

◆ VuoColor

struct VuoColor
Class Members
float a
float b
float g
float r

Function Documentation

◆ VuoColor_areEqual()

bool VuoColor_areEqual ( const VuoColor  a,
const VuoColor  b 
)

Returns true if both colors have the same intensity and alpha values.

◆ VuoColor_areEqualWithinTolerance()

bool VuoColor_areEqualWithinTolerance ( const VuoColor  a,
const VuoColor  b,
const float  tolerance 
)

Like VuoColor_areEqual(), but permits color channel values to differ by up to tolerance.

◆ VuoColor_average()

VuoColor VuoColor_average ( VuoList_VuoColor  colors)

Returns the weighted (by alpha) average of colors.

If there are no colors in the list, returns transparent black.

◆ VuoColor_getCMYKA()

void VuoColor_getCMYKA ( VuoColor  color,
VuoReal c,
VuoReal m,
VuoReal y,
VuoReal k,
VuoReal a 
)

Get the Cyan, Magenta, Yellow, Black, and Alpha values from a VuoColor.

◆ VuoColor_getHex()

VuoText VuoColor_getHex ( VuoColor  color,
VuoBoolean  includeAlpha 
)

Returns a hex string (like #445566ff) representing the color.

◆ VuoColor_getHSLA()

void VuoColor_getHSLA ( VuoColor  color,
VuoReal h,
VuoReal s,
VuoReal l,
VuoReal a 
)

Gets the hue, saturation, lightness, hue, alpha of a color.

Each value is in the range [0,1].

◆ VuoColor_getJson()

struct json_object * VuoColor_getJson ( const VuoColor  value)

Encodes value as a JSON object.

◆ VuoColor_getLightness()

VuoReal VuoColor_getLightness ( VuoColor  color)

Returns the HSL lightness of the color, in the range [0,1].

◆ VuoColor_getRGBA()

static void VuoColor_getRGBA ( VuoColor  color,
VuoReal r,
VuoReal g,
VuoReal b,
VuoReal a 
)
inlinestatic

Gets the red, green, blue, alpha of a color.

Each value is in the range [0,1], and specifies a color in the sRGB color space.

RGB are not premultiplied by A.

◆ VuoColor_getShortSummary()

char* VuoColor_getShortSummary ( const VuoColor  value)

Returns a short HTML representation of value.

◆ VuoColor_getString()

char* VuoColor_getString ( const VuoColor  value)

Automatically generated function.

◆ VuoColor_getSummary()

char* VuoColor_getSummary ( const VuoColor  value)

Returns a detailed HTML representation of value.

◆ VuoColor_isLessThan()

bool VuoColor_isLessThan ( const VuoColor  a,
const VuoColor  b 
)

Returns true if a < b.

◆ VuoColor_lerp()

static VuoColor VuoColor_lerp ( VuoColor  a,
VuoColor  b,
float  t 
) const
inlinestatic

Returns a linearly-interpolated value between a and b using time t (between 0 and 1).

◆ VuoColor_makeFromJson()

VuoColor VuoColor_makeFromJson ( json_object js)


Decodes the JSON object js to create a new value.

Example:
{
"r" : 0.5,
"g" : 1,
"b" : 0,
"a" : 1
}

◆ VuoColor_makeFromString()

VuoColor VuoColor_makeFromString ( const char *  str)

Automatically generated function.

◆ VuoColor_makeWithCMYKA()

VuoColor VuoColor_makeWithCMYKA ( VuoReal  c,
VuoReal  m,
VuoReal  y,
VuoReal  k,
VuoReal  a 
)

Creates a new VuoColor from CMYK values.

◆ VuoColor_makeWithHSLA()

VuoColor VuoColor_makeWithHSLA ( VuoReal  hue,
VuoReal  saturation,
VuoReal  luminosity,
VuoReal  alpha 
)

Returns a VuoColor with the given hue, saturation, lightness, alpha.

Parameters
hueColor circle from 0 (red) to 1/3 (green) to 2/3 (blue) to 1 (red). Values beyond that range are wrapped.
saturation0 to 1
luminosity0 to 1
alpha0 to 1

◆ VuoColor_makeWithRGBA()

static VuoColor VuoColor_makeWithRGBA ( VuoReal  r,
VuoReal  g,
VuoReal  b,
VuoReal  a 
) const
inlinestatic

Returns a VuoColor with the given red, green, blue, alpha.

Assumes each value is in the range [0,1], and specifies a color in the sRGB color space.

You should not premultiply RGB by A.

◆ VuoColor_premultiply()

static VuoColor VuoColor_premultiply ( VuoColor  c) const
inlinestatic

Returns a VuoColor whose red, green, and blue values have been multiplied by its alpha.

◆ VuoColor_release()

void VuoColor_release ( VuoColor  value)

Automatically generated function.

◆ VuoColor_retain()

void VuoColor_retain ( VuoColor  value)

Automatically generated function.