diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-31 16:35:40 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-31 16:35:40 -0500 |
commit | 3f22228a220d065af3f99ba6a538ff80517ecaa2 (patch) | |
tree | 918e0254e63eb63ad9311491022ee55be2f312ac /math.c | |
parent | e26bc35d04c136a142da37a87f6ba47940399879 (diff) |
configurable colors
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -700,6 +700,13 @@ static void gl_color2f(float v, float a) { glColor4f(v,v,v,a); } +static void rgba_u32_to_floats(u32 rgba, float floats[static 4]) { + floats[0] = (float)(rgba >> 24) / 255.f; + floats[1] = (float)(rgba >> 16) / 255.f; + floats[2] = (float)(rgba >> 8) / 255.f; + floats[3] = (float)(rgba >> 0) / 255.f; +} + // color is 0xRRGGBBAA static void gl_color_rgba(u32 color) { glColor4ub((u8)(color >> 24), (u8)(color >> 16), (u8)(color >> 8), (u8)color); |