Vuo
2.0.0
|
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) |
json_object * | VuoColor_getJson (const VuoColor value) |
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 bool | VuoColor_isOpaque (VuoColor color) |
Returns true if the color is fully opaque. More... | |
bool | VuoColor_areAllOpaque (VuoList_VuoColor colors) |
Returns true if all colors are fully opaque. More... | |
VuoReal | VuoColor_brightness (VuoColor color, int32_t type) |
Returns a measure of the brightness of color . 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... | |
bool VuoColor_areAllOpaque | ( | VuoList_VuoColor | colors | ) |
Returns true if all colors are fully opaque.
If the list is empty, returns false.
Definition at line 402 of file VuoColor.c.
Returns true if both colors have the same intensity and alpha values.
Definition at line 455 of file VuoColor.c.
Like VuoColor_areEqual(), but permits color channel values to differ by up to tolerance
.
Definition at line 466 of file VuoColor.c.
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.
Definition at line 372 of file VuoColor.c.
Returns a measure of the brightness of color
.
Definition at line 423 of file VuoColor.c.
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.
Definition at line 347 of file VuoColor.c.
VuoText VuoColor_getHex | ( | VuoColor | color, |
VuoBoolean | includeAlpha | ||
) |
Returns a hex string (like #445566ff
) representing the color.
Definition at line 230 of file VuoColor.c.
Gets the hue, saturation, lightness, hue, alpha of a color.
Each value is in the range [0,1].
Definition at line 292 of file VuoColor.c.
struct json_object * VuoColor_getJson | ( | const VuoColor | value | ) |
Encodes value
as a JSON object.
Definition at line 147 of file VuoColor.c.
Returns the HSL lightness of the color, in the range [0,1].
Definition at line 324 of file VuoColor.c.
|
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.
Definition at line 77 of file VuoColor.h.
char* VuoColor_getShortSummary | ( | const VuoColor | value | ) |
Returns a short HTML representation of value
.
Definition at line 165 of file VuoColor.c.
char* VuoColor_getString | ( | const VuoColor | value | ) |
Automatically generated function.
char* VuoColor_getSummary | ( | const VuoColor | value | ) |
Returns a detailed HTML representation of value
.
Definition at line 177 of file VuoColor.c.
Returns true if a < b.
Definition at line 477 of file VuoColor.c.
|
inlinestatic |
Returns true if the color is fully opaque.
Definition at line 109 of file VuoColor.h.
Returns a linearly-interpolated value between a
and b
using time t
(between 0 and 1).
Definition at line 122 of file VuoColor.h.
VuoColor VuoColor_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
Definition at line 49 of file VuoColor.c.
VuoColor VuoColor_makeFromString | ( | const char * | str | ) |
Automatically generated function.
Creates a new VuoColor from CMYK values.
Definition at line 334 of file VuoColor.c.
VuoColor VuoColor_makeWithHSLA | ( | VuoReal | hue, |
VuoReal | saturation, | ||
VuoReal | luminosity, | ||
VuoReal | alpha | ||
) |
Returns a VuoColor
with the given hue, saturation, lightness, alpha.
hue | Color circle from 0 (red) to 1/3 (green) to 2/3 (blue) to 1 (red). Values beyond that range are wrapped. |
saturation | 0 to 1 |
luminosity | 0 to 1 |
alpha | 0 to 1 |
Definition at line 255 of file VuoColor.c.
|
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.
Definition at line 64 of file VuoColor.h.
Returns a VuoColor
whose red, green, and blue values have been multiplied by its alpha.
Definition at line 89 of file VuoColor.h.
void VuoColor_release | ( | VuoColor | value | ) |
Automatically generated function.
void VuoColor_retain | ( | VuoColor | value | ) |
Automatically generated function.