summaryrefslogtreecommitdiffstats
path: root/tksao/colorbar/colorbarrgb.C
diff options
context:
space:
mode:
Diffstat (limited to 'tksao/colorbar/colorbarrgb.C')
-rw-r--r--tksao/colorbar/colorbarrgb.C8
1 files changed, 8 insertions, 0 deletions
diff --git a/tksao/colorbar/colorbarrgb.C b/tksao/colorbar/colorbarrgb.C
index 7eb953f..2a4b126 100644
--- a/tksao/colorbar/colorbarrgb.C
+++ b/tksao/colorbar/colorbarrgb.C
@@ -186,6 +186,14 @@ void ColorbarRGB::reset()
void ColorbarRGB::updateColorCells()
{
+ int clrs = (((ColorbarBaseOptions*)options)->colors);
+ if (clrs != colorCount) {
+ colorCount = clrs;
+ if (colorCells)
+ delete [] colorCells;
+ colorCells = new unsigned char[colorCount*3];
+ }
+
// fill rgb table
// note: its filled bgr to match XImage
// for(int i=0; i<colorCount; i++) {