Browse Source

cosmopolitan support

master
user 3 years ago
parent
commit
fbf7c25226
  1. 3
      colours.c
  2. 7
      colours.h

3
colours.c

@ -90,6 +90,7 @@ struct colour get_hs_l_v(struct colour c, enum colour_space sp) { @@ -90,6 +90,7 @@ struct colour get_hs_l_v(struct colour c, enum colour_space sp) {
ret.s = (ret.v - ret.l) / m_min(arr, 2);
}
}
ret.sp = CS_HSL;
return ret;
}
@ -231,8 +232,6 @@ void test_print_wheel() { @@ -231,8 +232,6 @@ void test_print_wheel() {
for(int i = 0; i < 360; i+=5) {
c.h = (double)i;
struct colour rgb = get_rgb(c);
/*printf("HSL: %f %f %f\n",c.h, c.s, c.l);*/
/*printf("RGB: %d %d %d\n",rgb.r,rgb.g,rgb.b);*/
print_colour(rgb);
}

7
colours.h

@ -11,9 +11,10 @@ @@ -11,9 +11,10 @@
#define H_COLOURS
enum colour_space {
CS_RGB = 0, // default to RGB
CS_HSV = 1,
CS_HSL = 2,
CS_INVALID = 0,
CS_RGB = 1, // default to RGB
CS_HSV = 2,
CS_HSL = 3,
};
struct colour {

Loading…
Cancel
Save