|
@@ -49,6 +49,20 @@ public:
|
|
|
/// Get a visually distinct color
|
|
/// Get a visually distinct color
|
|
|
static Color sGetDistinctColor(int inIndex);
|
|
static Color sGetDistinctColor(int inIndex);
|
|
|
|
|
|
|
|
|
|
+ /// Get a color value on the gradient from green through yellow to red
|
|
|
|
|
+ /// @param inValue Value in the range [0, 1], 0 = green, 0.5 = yellow, 1 = red
|
|
|
|
|
+ static Color sGreenRedGradient(float inValue)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (inValue < 0.0f)
|
|
|
|
|
+ return Color::sGreen;
|
|
|
|
|
+ else if (inValue < 0.5f)
|
|
|
|
|
+ return Color(uint8(510.0f * inValue), 255, 0);
|
|
|
|
|
+ else if (inValue < 1.0f)
|
|
|
|
|
+ return Color(255, uint8(510.0f * (1.0f - inValue)), 0);
|
|
|
|
|
+ else
|
|
|
|
|
+ return Color::sRed;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// Predefined colors
|
|
/// Predefined colors
|
|
|
static const Color sBlack;
|
|
static const Color sBlack;
|
|
|
static const Color sDarkRed;
|
|
static const Color sDarkRed;
|