Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.
 
json_objectVuoColor_getJson (const VuoColor value)
 Encodes value as a JSON object.
 
char * VuoColor_getSummary (const VuoColor value)
 Returns a compact string representation of value (comma-separated components).
 
bool VuoColor_areEqual (const VuoColor a, const VuoColor b)
 Returns true if both colors have the same intensity and alpha values.
 
bool VuoColor_isLessThan (const VuoColor a, const VuoColor b)
 Returns true if a < b.
 
static VuoColor VuoColor_makeWithRGBA (VuoReal r, VuoReal g, VuoReal b, VuoReal a) __attribute__((const ))
 Returns a VuoColor with the given red, green, blue, alpha.
 
static void VuoColor_getRGBA (VuoColor color, VuoReal *r, VuoReal *g, VuoReal *b, VuoReal *a)
 Gets the red, green, blue, alpha of a color.
 
VuoColor VuoColor_makeWithHSLA (VuoReal hue, VuoReal saturation, VuoReal luminosity, VuoReal alpha)
 Returns a VuoColor with the given hue, saturation, lightness, alpha.
 
void VuoColor_getHSLA (VuoColor color, VuoReal *h, VuoReal *s, VuoReal *l, VuoReal *a)
 Gets the hue, saturation, lightness, hue, alpha of a color.
 
VuoText VuoColor_getHex (VuoColor color, VuoBoolean includeAlpha)
 Returns a hex string (like #445566ff) representing the color.
 
VuoColor VuoColor_average (VuoList_VuoColor colors)
 Returns the weighted (by alpha) average of colors.
 
VuoColor VuoColor_makeFromString (const char *str)
 Automatically generated function.
 
char * VuoColor_getString (const VuoColor value)
 Automatically generated function.
 
void VuoColor_retain (VuoColor value)
 Automatically generated function.
 
void VuoColor_release (VuoColor value)
 Automatically generated function.
 

Class Documentation

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

Function Documentation

bool VuoColor_areEqual ( const VuoColor  a,
const VuoColor  b 
)

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

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.

VuoText VuoColor_getHex ( VuoColor  color,
VuoBoolean  includeAlpha 
)

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

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].

struct json_object * VuoColor_getJson ( const VuoColor  value)
read

Encodes value as a JSON object.

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.

char* VuoColor_getString ( const VuoColor  value)

Automatically generated function.

char * VuoColor_getSummary ( const VuoColor  value)

Returns a compact string representation of value (comma-separated components).

bool VuoColor_isLessThan ( const VuoColor  a,
const VuoColor  b 
)

Returns true if a < b.

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 VuoColor_makeFromString ( const char *  str)

Automatically generated function.

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
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.

void VuoColor_release ( VuoColor  value)

Automatically generated function.

void VuoColor_retain ( VuoColor  value)

Automatically generated function.