Skip to content
Snippets Groups Projects
Commit 3d9fa924 authored by Corentin Carton De Wiart's avatar Corentin Carton De Wiart
Browse files

New colormap

parent 4b35d709
No related branches found
No related tags found
No related merge requests found
...@@ -246,8 +246,30 @@ void ColorTable_Recompute(GmshColorTable * ct) ...@@ -246,8 +246,30 @@ void ColorTable_Recompute(GmshColorTable * ct)
r = g = b = (int)(255 * (1. - curvature)); r = g = b = (int)(255 * (1. - curvature));
} }
break; break;
case 10: // all white case 10: // "french flag"
r = g = b = 255; {
double ii = (double)(s - bias);
if(ii < 0) ii = 0;
if(ii > 1) ii = 1;
double rr =
ii >= .75 ? 2*(0.75-ii) + 1.:
ii >= .5 ? 1. :
ii >= .25 ? 4. * (ii-0.25) :
0.;
double gg =
ii <= .25 ? 1.33333 * ii :
ii <= .5 ? 0.33333 + 2.66667 * (ii-0.25) :
ii <= .75 ? 1 - 2.66667 * (ii-0.5) :
1.33333 * (1.-ii);
double bb =
ii <= 0.25 ? 2*ii + 0.5 :
ii <= 0.5 ? 1. :
ii <= 0.75 ? 4*(0.75-ii) :
0.;
r = (int)(rr * 255.);
g = (int)(gg * 255.);
b = (int)(bb * 255.);
}
break; break;
case 11: // matlab "hsv" case 11: // matlab "hsv"
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment