cf_make_pixel_hex¶
Category: graphics
GitHub: cute_color.h
Returns a CF_Pixel made from integer hex input.
CF_Pixel cf_make_pixel_hex(int hex) { unsigned int h = (unsigned int)hex; return cf_make_pixel_rgba((uint8_t)((h & 0xFF000000) >> 24), (uint8_t)((h & 0x00FF0000) >> 16), (uint8_t)((h & 0x0000FF00) >> 8), (uint8_t)(h & 0x000000FF)); }
| Parameters | Description |
|---|---|
hex |
An integer value, e.g. 0xFFAACC11. |
Related Pages¶
CF_Pixel
cf_make_pixel_rgb_f
cf_make_pixel_rgba_f
cf_make_pixel_rgb
cf_make_pixel_rgba
cf_make_pixel_hex_string