forked from zlsa/libcolor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolor_test.cpp
More file actions
42 lines (30 loc) · 1.33 KB
/
Copy pathcolor_test.cpp
File metadata and controls
42 lines (30 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//@ {"targets":[{"name":"test","type":"application"}]}
#include "color.hpp"
int main()
{
for(int k=0;k<5;++k)
{
for(int l=0;l<5;++l)
{
for(int m=0;m<5;++m)
{
Color::SRGBA test_a(float(k)/4.0f,float(l)/4.0f,float(m)/4.0f,1.0f);
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
test_a=Color::SRGBA(Color::RGBA(Color::HCYA(Color::RGBA(test_a))));
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
test_a=Color::SRGBA(Color::HSLA(test_a));
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
test_a=Color::SRGBA(Color::HSVA(test_a));
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
test_a=Color::SRGBA(Color::RGBA( test_a));
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
test_a=Color::SRGBA(Color::RGBA( Color::XYZA(Color::RGBA(test_a))));
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
test_a=Color::SRGBA(Color::RGBA( Color::HCIA(Color::RGBA(test_a))));
printf("(%.6f,%.6f,%.6f,%.6f)\n",test_a.red(),test_a.green(),test_a.blue(),test_a.alpha());
putchar('\n');
}
}
}
return 0;
}