Vuo
1.2.3
|
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_object * | VuoColor_getJson (const VuoColor value) |
Encodes value as a JSON object. | |
char * | VuoColor_getSummary (const VuoColor value) |
Returns an HTML 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. | |
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 . | |
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. | |
static VuoColor | VuoColor_premultiply (VuoColor c) __attribute__((const )) |
Returns a VuoColor whose red, green, and blue values have been multiplied by its alpha. | |
VuoColor | VuoColor_makeWithCMYKA (VuoReal c, VuoReal m, VuoReal y, VuoReal k, VuoReal a) |
Creates a new VuoColor from CMYK values. | |
void | VuoColor_getHSLA (VuoColor color, VuoReal *h, VuoReal *s, VuoReal *l, VuoReal *a) |
Gets the hue, saturation, lightness, hue, 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_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. | |
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. | |
Returns true if both colors have the same intensity and alpha values.
Like VuoColor_areEqual(), but permits color channel values to differ by up to tolerance
.
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.
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.
VuoText VuoColor_getHex | ( | VuoColor | color, |
VuoBoolean | includeAlpha | ||
) |
Returns a hex string (like #445566ff
) representing the color.
Gets the hue, saturation, lightness, hue, alpha of a color.
Each value is in the range [0,1].
|
read |
Encodes value
as a JSON object.
|
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.
char* VuoColor_getString | ( | const VuoColor | value | ) |
Automatically generated function.
char * VuoColor_getSummary | ( | const VuoColor | value | ) |
Returns an HTML representation of value
(comma-separated components).
VuoColor VuoColor_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
VuoColor VuoColor_makeFromString | ( | const char * | str | ) |
Automatically generated function.
Creates a new VuoColor from CMYK values.
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 |
|
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.
Returns a VuoColor
whose red, green, and blue values have been multiplied by its alpha.
void VuoColor_release | ( | VuoColor | value | ) |
Automatically generated function.
void VuoColor_retain | ( | VuoColor | value | ) |
Automatically generated function.