Restore original saturation and brightness

This commit is contained in:
matze19999 committed 2026-10-06 16:23:09 +02:00
1 parent 81087448b2
commit c3a2ac8002
9 files changed
+16 -25

No files matched your search

+4 -4
View File
@@ -5,16 +5,16 @@ int main(void){
unsigned char out[3];
for(unsigned v=0;v<256;v++){
unsigned char gray[3]={v,v,v};boost_color(gray,out);
unsigned expected=(v*133+50)/100;if(expected>255)expected=255;
unsigned expected=v;
assert(out[0]==expected && out[1]==expected && out[2]==expected);
}
unsigned char cyan[3]={93,224,242};boost_color(cyan,out);
assert(out[0]<93 && out[1]>out[0] && out[1]<out[2] && out[2]==255);
assert(out[0]==93 && out[1]==224 && out[2]==242);
for(unsigned c=0;c<3;c++){
unsigned char primary[3]={0};primary[c]=255;boost_color(primary,out);
for(unsigned j=0;j<3;j++)assert(out[j]==primary[j]);
}
unsigned char warm[3]={171,82,0};boost_color(warm,out);
assert(out[0]==227 && out[1]>82 && out[2]==0);
puts("PASS: neutral grays, stronger cyan, brighter warm color, clamped primaries");
assert(out[0]==171 && out[1]==82 && out[2]==0);
puts("PASS: neutral grays, unchanged cyan, warm color and primaries");
}