Package org.evoludo.simulator
Class ColorMapCSS.Gradient1D
- Enclosing class:
ColorMapCSS
One dimensional color gradient spanning two or more 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
-
Constructor Summary
ConstructorsConstructorDescriptionGradient1D
(Color[] colors, int nIncr) Construct color gradient running through all the colors in the arraycolors
.Gradient1D
(Color[] colors, int trait, int nIncr) Construct color gradient running through all the colors in the arraycolors
.Gradient1D
(Color start, Color end, int nIncr) Construct color gradient ranging from colorstart
to colorend
and interpolate withsteps-1
intermediate colors.Gradient1D
(Color start, Color end, int trait, int nIncr) Construct color gradient ranging from colorstart
to colorend
and interpolate withsteps-1
intermediate colors. -
Method Summary
Modifier and TypeMethodDescriptioncolor2Color
(Color color) Utility method to convert thecolor
into a color object of typeT
.Methods inherited from class ColorMap.Gradient1D
binOf, setColor, setColor, setGradient, setGradient, setRange, translate, translate, translate, translate
Methods inherited from class ColorMap.Gradient
interpolateColors, interpolateColors
Methods inherited from class ColorMap
addAlpha, addAlpha, addColors, blendColors, blendColors, translate, translate, translate
-
Constructor Details
-
Gradient1D
Construct color gradient ranging from colorstart
to colorend
and interpolate withsteps-1
intermediate colors. The resulting gradient spanssteps+1
colors. The default range for mapping data values onto the color gradient is[0.0, 1.0]
.- Parameters:
start
- the starting colorend
- the ending colornIncr
- the number of intermediate colors- See Also:
-
Gradient1D
Construct color gradient ranging from colorstart
to colorend
and interpolate withsteps-1
intermediate colors. The resulting gradient spanssteps+1
colors. The default range for mapping data values onto the color gradient is[0.0, 1.0]
.- Parameters:
start
- the starting colorend
- the ending colortrait
- the index of the traitnIncr
- the number of intermediate colors- See Also:
-
Gradient1D
Construct color gradient running through all the colors in the arraycolors
. The number of interpolated intermediate colors between two subsequent entries incolors
is(steps-1)/(N-1)
, whereN
is the number of colors incolors
. The resulting gradient spanssteps+1
colors. The default range for mapping data values onto the color gradient is[0.0, 1.0]
.- Parameters:
colors
- the equally spaced reference colors of the gradientnIncr
- the number of intermediate, gradient colors- See Also:
-
Gradient1D
Construct color gradient running through all the colors in the arraycolors
. The number of interpolated intermediate colors between two subsequent entries incolors
is(steps-1)/(N-1)
, whereN
is the number of colors incolors
. The resulting gradient spanssteps+1
colors. The default range for mapping data values onto the color gradient is[0.0, 1.0]
.- Parameters:
colors
- the equally spaced reference colors of the gradienttrait
- the index of the traitnIncr
- the number of intermediate, gradient colors- See Also:
-
-
Method Details
-
color2Color
Description copied from class:ColorMap
Utility method to convert thecolor
into a color object of typeT
.- Specified by:
color2Color
in classColorMap<String>
- Parameters:
color
- the color to convert- Returns:
- the color represented as an object of type
T
-