<<
path:
root/public/0x2lib.git/html/tests/colored.jai
blob: d4e22f2129f3bb0582cd4d4abe922dfe3cfd5737
[raw]
[clear marker]
4 /** Test: HSL routines */
6 hsl_string := "154 87 53";
7 hsl, ok := string_to_hsl(hsl_string);
10 rgb_hex := hsl_to_rgb_hex(hsl_string);
11 ass(rgb_hex, "#1FEF95");
13 rgb := hsl_to_rgb(hsl);
14 ass(rgb, RGB.{ 31, 239, 149 });
17 h, s, l := hsl_to_integers(hsl);
18 hsl = integers_to_hsl(h, s, l);
19 ass(hsl, HSL.{ 154, 87, 53 });
22 /** Test: RGB routines */
24 rgb_string := "#C0FFEE";
25 rgb, ok = string_to_rgb(rgb_string);
28 hsl = rgb_to_hsl(rgb);
29 ass(hsl, HSL.{ 164, 100, 88 });
31 r, g, b := rgb_to_integers(rgb);
32 rgb = integers_to_rgb(r, g, b);
33 ass(rgb, RGB.{ 192, 255, 238 });
42ass :: (a: RGB, b: RGB, loc := #caller_location) -> bool #expand {
47 if !ok then #insert,scope() ASS_CODE;
50ass :: (a: HSL, b: HSL, loc := #caller_location) -> bool #expand {
55 if !ok then #insert,scope() ASS_CODE;
61#import,file "../0x2_Colored.jai";