natiny_color_from_rgba
C
NatinyColor natiny_color_from_rgba(float r, float g, float b, float a);
Returns an RGBA color packed into a NatinyColor.
Parameters
| Name |
Type |
Description |
r |
float |
Red channel, from 0.0f to 1.0f |
g |
float |
Green channel, from 0.0f to 1.0f |
b |
float |
Blue channel, from 0.0f to 1.0f |
a |
float |
Alpha channel, from 0.0f to 1.0f |
Returns
| Type |
Description |
NatinyColor |
Packed 32-bit color in 0xRRGGBBAA layout |
Example
C
NatinyColor orange = natiny_color_from_rgba(1.0f, 0.55f, 0.15f, 1.0f);
natiny_render_set_color(orange);
Notes
- Components are clamped to
0.0f through 1.0f and quantized to 8 bits.