Package org.evoludo.simulator
Class ColorMap3D.Index
- Enclosing class:
ColorMap3D
Associates integer indices with colors.
-
Nested Class Summary
Nested classes/interfaces inherited from class ColorMap
ColorMap.Gradient<T>, ColorMap.Gradient1D<T>, ColorMap.Gradient2D<T>, ColorMap.GradientND<T>, ColorMap.Hue<T>, ColorMap.Index<T>
-
Field Summary
Fields inherited from class ColorMap.Index
colors, nColors, srccolors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolor2Color
(Color color) Utility method to convert thecolor
into a color object of typeT
.toGradient1D
(int nIncr) Convert the index colors into a 1D gradient with a total ofnIncr
shades.Methods inherited from class ColorMap.Index
getColors, setColor, setColor, translate
-
Constructor Details
-
Index
Construct a new Index color map.- Parameters:
colors
- the array of colors to assign to indices
-
Index
Construct a new Index color map with transparency where \(\alpha\in[0,255]\) with \(0\) fully transparent and \(255\) fully opaque.Note: this is a convenient way to generate maps with a different transparency. The transparency of the supplied colors is always honoured but overruled if
alpha != 255
.- Parameters:
colors
- the array of colors to assign to indicesalpha
- the alpha value for opaque colors
-
-
Method Details
-
color2Color
Description copied from class:ColorMap
Utility method to convert thecolor
into a color object of typeT
.- Specified by:
color2Color
in classColorMap<MeshLambertMaterial>
- Parameters:
color
- the color to convert- Returns:
- the color represented as an object of type
T
-
toGradient1D
Description copied from class:ColorMap.Index
Convert the index colors into a 1D gradient with a total ofnIncr
shades.- Specified by:
toGradient1D
in classColorMap.Index<MeshLambertMaterial>
- Parameters:
nIncr
- the total number of color increments- Returns:
- the 1D color gradient
-