(#108) remove dead code

master
rexim 2018-11-12 19:11:13 +07:00
parent dec287df1f
commit 7fae19fa22
2 changed files with 5 additions and 16 deletions

View File

@ -15,15 +15,6 @@ Color rgba(float r, float g, float b, float a)
return result;
}
Color color256(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
{
return rgba(
(float) r / 255.0f,
(float) g / 255.0f,
(float) b / 255.0f,
(float) a / 255.0f);
}
static Uint8 hex2dec_digit(char c)
{
if (c >= '0' && c <= '9') {
@ -52,11 +43,11 @@ Color color_from_hexstr(const char *hexstr)
return rgba(0.0f, 0.0f, 0.0f, 1.0f);
}
return color256(
parse_color_component(hexstr),
parse_color_component(hexstr + 2),
parse_color_component(hexstr + 4),
255);
return rgba(
parse_color_component(hexstr) / 255.0f,
parse_color_component(hexstr + 2) / 255.0f,
parse_color_component(hexstr + 4) / 255.0f,
1.0f);
}
SDL_Color color_for_sdl(Color color)

View File

@ -8,8 +8,6 @@ typedef struct Color {
} Color;
Color rgba(float r, float g, float b, float a);
// TODO: color256 -> rgba256
Color color256(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
// TODO: color_from_hexstr -> hexstr
Color color_from_hexstr(const char *hexstr);
SDL_Color color_for_sdl(Color color);