46 if(value > 1.) {value=1.;}
47 if(value < 0.) {value=0.;}
54 } colormap[NCOLOR] = {{0.0, {1., 1., 1., 1.}},
55 {0.2, {0., 0., 1., 1.}},
56 {0.4, {0., 1., 1., 1.}},
57 {0.6, {0., 1., 0., 1.}},
58 {0.8, {1., 1., 0., 1.}},
59 {1.0, {1., 0., 0., 1.}}};
62 G4int during[2] = {0, 0};
63 for(
int i = 1; i < NCOLOR; i++) {
64 if(colormap[i].val >= value) {
72 G4double a = std::fabs(value - colormap[during[0]].val);
73 G4double b = std::fabs(value - colormap[during[1]].val);
74 for(
int i = 0; i < 4; i++) {
75 color[i] = (b*colormap[during[0]].rgb[i] + a*colormap[during[1]].rgb[i])
76 /(colormap[during[1]].val - colormap[during[0]].val);
77 if(color[i] > 1.) color[i] = 1.;
virtual void GetMapColor(G4double val, G4double color[4])
virtual ~G4DefaultLinearColorMap()
G4DefaultLinearColorMap(G4String mName)