Skip to content

cf_make_pixel_rgb_f

Category: graphics
GitHub: cute_color.h


Returns a CF_Pixel made from RGB float inputs.

CF_Pixel cf_make_pixel_rgb_f(float r, float g, float b) { CF_Pixel p; p.colors.r = (uint8_t)(r * 255.0f); p.colors.g = (uint8_t)(g * 255.0f); p.colors.b = (uint8_t)(b * 255.0f); p.colors.a = 255; return p; }
Parameters Description
r The red component from 0.0f to 1.0f.
g The green component from 0.0f to 1.0f.
b The blue component from 0.0f to 1.0f.

Remarks

The alpha component is set to 255.

CF_Pixel
cf_make_pixel_hex_string
cf_make_pixel_rgba_f
cf_make_pixel_rgb
cf_make_pixel_rgba
cf_make_pixel_hex