diff --git a/Common/ColorTable.cpp b/Common/ColorTable.cpp index 8662530838ae8268847b3be0fa6967da068adb78..437066e00b7971c541d5f41ffcc8a30d8393f2f0 100644 --- a/Common/ColorTable.cpp +++ b/Common/ColorTable.cpp @@ -1,4 +1,4 @@ -// $Id: ColorTable.cpp,v 1.7 2002-02-14 17:09:45 geuzaine Exp $ +// $Id: ColorTable.cpp,v 1.8 2002-02-14 17:22:06 geuzaine Exp $ #include "Gmsh.h" #include "ColorTable.h" @@ -80,7 +80,7 @@ void ColorTable_Recompute(GmshColorTable *ct, int rgb_flag, int alpha_flag){ r = 255 ; g = 0 ; b = 0 ; } break; - case 3: /* rainbow */ + case 3: /* rainbow (matlab, etc.) */ if (s-bias<=0.00) { r = 0 ; g = 0 ; b = 255 ; } @@ -90,7 +90,8 @@ void ColorTable_Recompute(GmshColorTable *ct, int rgb_flag, int alpha_flag){ } else if(s-bias<=0.50) { curve = (curve == 0.25)? 0.26 : curve; - r = 0 ; g = 255 ; b = (int)(255.-(255./(0.25-curve))*(s-bias-0.25-curve)); + r = 0 ; g = 255 ; + b = (int)(255.-(255./(0.25-curve))*(s-bias-0.25-curve)); } else if(s-bias<=0.75-curve){ curve = (curve == 0.25)? 0.26 : curve; @@ -104,7 +105,7 @@ void ColorTable_Recompute(GmshColorTable *ct, int rgb_flag, int alpha_flag){ r = 255 ; g = 0 ; b = 0 ; } break; - case 4: /* rainbow modified to add black and white , from EMC2000 */ + case 4: /* darkblue-red-yellow-white */ #define myfct(a,b,c,d) ((a)+\ (b)*(s-bias)+\ (c)*(s-bias)*(s-bias)+\ @@ -130,7 +131,8 @@ void ColorTable_Recompute(GmshColorTable *ct, int rgb_flag, int alpha_flag){ r = 0 ; g = 0 ; b = 0 ; } else if(s-bias<=0.2){ - r = (int)(57*(1-100*((s-bias)-0.1)*((s-bias)-0.1))) ; g = 0 ; b = (int)((s-bias)*(255./0.2)) ; + r = (int)(57*(1-100*((s-bias)-0.1)*((s-bias)-0.1))) ; g = 0 ; + b = (int)((s-bias)*(255./0.2)) ; } else if(s-bias<=0.3624){ r = 0 ; g = (int)((s-bias-0.2)*(255./0.1624)) ; b = 255 ; @@ -145,13 +147,15 @@ void ColorTable_Recompute(GmshColorTable *ct, int rgb_flag, int alpha_flag){ r = 255; g = (int)(255.-(255./0.1624)*(s-bias-0.6376)) ; b = 0 ; } else if(s-bias<=1.0) { - r = 255; g = (int)((255./0.2)*(s-bias-0.8)) ; b = (int)(-3187.66*(s-bias)*(s-bias)+7012.76*(s-bias)-3570.61) ; + r = 255; g = (int)((255./0.2)*(s-bias-0.8)) ; + b = (int)(-3187.66*(s-bias)*(s-bias)+7012.76*(s-bias)-3570.61) ; } else { r = 255 ; g = 255 ; b = 255 ; } break; - default: /* grayscale without white */ + case 8: /* grayscale, without white */ + default: if (s-bias<=0.00){ r = g = b = 0 ; } else if (s-bias<=1.00){ r = g = b = (int)(220*(s-bias)); } else { r = g = b = 220 ; } diff --git a/Fltk/Colorbar_Window.cpp b/Fltk/Colorbar_Window.cpp index c4ec2d2ea5b52d4380c63d82bc3a2d38f4e09eb8..9c12383afa5521b9bd93c944e1f0a0df5988e555 100644 --- a/Fltk/Colorbar_Window.cpp +++ b/Fltk/Colorbar_Window.cpp @@ -1,4 +1,4 @@ -// $Id: Colorbar_Window.cpp,v 1.19 2002-02-14 17:09:45 geuzaine Exp $ +// $Id: Colorbar_Window.cpp,v 1.20 2002-02-14 17:22:06 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -246,7 +246,7 @@ void Colorbar_Window::redraw_range(int a, int b){ int xx0=10, xx1=13*font_height, yy0=10; if (help_flag){ i = 0; - fl_draw("1, 2, ..., 7", xx0,yy0+(i+1)*font_height); + fl_draw("1, 2, ..., 8", xx0,yy0+(i+1)*font_height); fl_draw( "select predefined colormap", xx1,yy0+(i+1)*font_height); i++; fl_draw("mouse1", xx0,yy0+(i+1)*font_height); fl_draw( "draw red or hue channel", xx1,yy0+(i+1)*font_height); i++;