Package org.evoludo.simulator
Class ColorMap3D.GradientND
- Enclosing class:
ColorMap3D
N dimensional color gradient with one color for each dimension.-
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.GradientND
bg, traits, weights -
Constructor Summary
ConstructorsConstructorDescriptionGradientND(Color[] colors) ConstructNdimensional color gradient to representNdimensional data values.GradientND(Color[] colors, int idx) ConstructNdimensional color gradient to representN+1dimensional data values where one data value is dependent on the other two.GradientND(Color[] colors, Color bg) ConstructNdimensional color gradient to representNdimensional data with a background color other than black, or, to representN+1dimensional data values where one data value is dependent on the otherN. -
Method Summary
Modifier and TypeMethodDescriptioncolor2Color(Color color) Utility method to convert thecolorinto a color object of typeT.toGradient1D(int nIncr) Convert theN-dimensional color map into a 1D gradient with a total ofnIncrshades.translate(double[] data) Translate the multi-traitdouble[]arraydatato a color.Methods inherited from class ColorMap.GradientND
translate, translateMethods inherited from class ColorMap.Gradient2D
binOf, binOf, setColor, setColor, setRange, setRange, setRange, setRangeMethods inherited from class ColorMap.Gradient
interpolateColors, interpolateColors, translateMethods inherited from class ColorMap
addAlpha, addAlpha, addColors, blendColors, blendColors, translate, translate
-
Constructor Details
-
GradientND
ConstructNdimensional color gradient to representNdimensional data values. Each dimensionispans colors ranging from black tocolors[i].The default range for mapping data values onto the color gradient is
[0.0, 1.0]in all dimensions.- Parameters:
colors- the colors for each dimension- See Also:
-
GradientND
ConstructNdimensional color gradient to representNdimensional data with a background color other than black, or, to representN+1dimensional data values where one data value is dependent on the otherN.The color gradient in each dimension
iranges frombgtocolors[i].The default range for mapping data values onto the color gradient is
[0.0, 1.0]in all dimensions.- Parameters:
colors- the colors for theNdimensionsbg- the color representing the background (or anN+1, dependent trait)- See Also:
-
GradientND
ConstructNdimensional color gradient to representN+1dimensional data values where one data value is dependent on the other two. This applies, for example, to data based on the replicator equation and dynamics that unfold on the simplexSN.The index of the dependent trait is
idx. It is at its maximum if all other traits are at their minimum. The color gradient in each dimensioniranges fromcolors[idx]tocolors[i]foridx≠i.The default range for mapping data values onto the color gradient is
[0.0, 1.0]in all dimensions.- Parameters:
colors- the colors for theNdimensionsidx- the index of the dependent trait- See Also:
-
-
Method Details
-
translate
Translate the multi-traitdouble[]arraydatato a color. The type of object returned depends on the implementation.GradientND: color gradients are generated on the fly.
- Overrides:
translatein classColorMap.Gradient2D<MeshLambertMaterial>- Parameters:
data- thedouble[]array to convert to a color- Returns:
- WebGL Material representing the corresponding gradient color
-
color2Color
Description copied from class:ColorMapUtility method to convert thecolorinto a color object of typeT.- Specified by:
color2Colorin classColorMap<MeshLambertMaterial>- Parameters:
color- the color to convert- Returns:
- the color represented as an object of type
T
-
toGradient1D
Description copied from class:ColorMap.GradientNDConvert theN-dimensional color map into a 1D gradient with a total ofnIncrshades. This is useful for coloring schemes that are based on an aggregate characteristics, such as the distance, instead of theN-dimensional data.- Specified by:
toGradient1Din classColorMap.GradientND<MeshLambertMaterial>- Parameters:
nIncr- the total number of color increments- Returns:
- the 1D color gradient
-