disabled color perturb if color not applicable

This commit is contained in:
Zeno Rogue committed 2019-09-12 22:43:00 +02:00
1 parent 49877fbfc9
commit edbf08b80c
1 file changed
+2 -1
+2 -1
View File
@@ -93,8 +93,9 @@ void buildhue() {
int perturb(int c) {
if(nh == 0) buildhue();
int hueid = 0;
int hueid = -1;
for(int t=0; t<nh; t++) if(hues[t] == c) hueid = t;
if(hueid == -1) return c;
hueid += rand() % 50;
hueid -= rand() % 50;
if(hueid<0) hueid += nh;