Class ColorScaleModel
java.lang.Object
cnuphys.splot.plot.ColorScaleModel
Used for color scales, such as on magnetic field plots
- Author:
- heddle
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorScaleModelGet a standard blue to red colors scalegetAlphaColor(double value, int alpha) Get a color via getColor but add an alpha valuegetColor(double value) Given a value, returns the corresponding color.Color[]Get the color array.Get the too-big color.Get the too-small color.voidsetTooBigColor(Color tooBigColor) voidsetTooSmallColor(Color tooSmallColor)
-
Field Details
-
_colors
The array of colors
-
-
Method Details
-
blueToRed
Get a standard blue to red colors scale- Returns:
- a standard blue to red color scale
-
getAlphaColor
Get a color via getColor but add an alpha value- Parameters:
value- the valuealpha- the alpha value [0..255]- Returns:
- the color corresponding to the value.
-
getColor
Given a value, returns the corresponding color. Example:values: {0, 2, 4, 6, 8}
colors: {R, G, B, Y}
then
value = 1.77 -> R
value = -1 -> tooSmallColor
value = 8.01 -> tooBigColor
value = 4 (exactly) -> G
- Parameters:
value- the for which we want the color.- Returns:
- the color corresponding to the value.
-
getColors
-
getTooBigColor
-
getTooSmallColor
Get the too-small color.- Returns:
- the color used for a "too small" value.
-
setTooSmallColor
- Parameters:
tooSmallColor- the tooSmallColor to set
-
setTooBigColor
- Parameters:
tooBigColor- the tooBigColor to set
-