Hue in HSV is wrapped if out of range for sake of robustness

This commit is contained in:
Paolo Cignoni 2016-10-07 00:49:34 +02:00
parent 9b9e4f6681
commit 07fe590814
1 changed files with 2 additions and 0 deletions

View File

@ -180,6 +180,8 @@ public:
(*this)[3]=255; (*this)[3]=255;
return; return;
} }
float dummy;
h = modff(h,&dummy);
if(h==1.0) h = 0.0; if(h==1.0) h = 0.0;
int i = int( floor(h*6.0) ); int i = int( floor(h*6.0) );