Skip to content

cf_make_pixel_rgba_f

Category: graphics
GitHub: cute_color.h


Returns a CF_Pixel made from RGBA float inputs.

CF_Pixel cf_make_pixel_rgba_f(float r, float g, float b, float a) { 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 = (uint8_t)(a * 255.0f); 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.
a The alpha component from 0.0f to 1.0f.

CF_Pixel
cf_make_pixel_rgb_f
cf_make_pixel_hex_string
cf_make_pixel_rgb
cf_make_pixel_rgba
cf_make_pixel_hex