cf_color_to_pixel¶
Category: graphics
GitHub: cute_color.h
Converts a CF_Color (0.0f to 1.0f) to a CF_Pixel (0-255).
CF_Pixel cf_color_to_pixel(CF_Color c) { CF_Pixel p; p.colors.r = (uint8_t)(c.r * 255.0f); p.colors.g = (uint8_t)(c.g * 255.0f); p.colors.b = (uint8_t)(c.b * 255.0f); p.colors.a = (uint8_t)(c.a * 255.0f); return p; }
| Parameters | Description |
|---|---|
c |
The color. |