Browse Source

misc refactoring

v1.x
Tj Holowaychuk 14 years ago
parent
commit
5ec4a8f52b
  1. 12
      src/color.cc

12
src/color.cc

@ -229,8 +229,8 @@ rgba_t
rgba_create(uint32_t rgba) { rgba_create(uint32_t rgba) {
rgba_t color; rgba_t color;
color.r = (double) (rgba >> 24) / 255; color.r = (double) (rgba >> 24) / 255;
color.g = (double) ((rgba & 0x00ff0000) >> 16) / 255; color.g = (double) (rgba >> 16 & 0xff) / 255;
color.b = (double) ((rgba & 0x0000ff00) >> 8) / 255; color.b = (double) (rgba >> 8 & 0xff) / 255;
color.a = (double) (rgba & 0xff) / 255; color.a = (double) (rgba & 0xff) / 255;
return color; return color;
} }
@ -415,9 +415,9 @@ rgba_from_string(const char *str, short *ok) {
void void
rgba_inspect(int32_t rgba) { rgba_inspect(int32_t rgba) {
printf("rgba(%d,%d,%d,%d)\n" printf("rgba(%d,%d,%d,%d)\n"
, rgba >> 24 & 0xFF , rgba >> 24 & 0xff
, rgba >> 16 & 0xFF , rgba >> 16 & 0xff
, rgba >> 8 & 0xFF , rgba >> 8 & 0xff
, rgba & 0xFF , rgba & 0xff
); );
} }

Loading…
Cancel
Save