ColorRamp
Description
- Derived from
-
ColorRampBase abstract
This class represents a color ramp that interpolates between defined slots.
A color ramp consists of zero or more color ramp slots, where the slots hold monotonically increasing coordinates with their respective color value. To create a color ramp, do this:
-
Use Color1 or Color2 for the trivial cases of one or two colors.
-
Otherwise, create a ColorRamp object, optionally passing in an initial capacity.
-
Use Add or Set to add slots to the color ramp. The latter can also be used to updated existing slots.
-
Use Count, ColorAt and CoordinateAt to query the slots.
Public / Constants
Earth
A color ramp for Earth with intuitive colors.
Use ellipsoid/geoid heights as input for the color ramp: -1000m .. 8000m.
Mars
A rainbow color ramp for Mars.
Use areoid heights as input for the color ramp: -7500m .. 15000m.
- See also
Mask
A simple mask shape.
To create an equivalent color ramp, call Shape, passing 0 to the first parameter and the default values to the remaining ones.
Moon
A rainbow color ramp for the Moon.
Use reference sphere heights as input for the color ramp: -9000m .. 10000m.
- See also
Outline
A simple outline shape.
To create an equivalent color ramp, call Shape, the default parameter values.
Planet
A rainbow color ramp for a planet.
Use normalized heights as input for the color ramp: -1 .. +1.
- See also
Public / Constructors
Color
2 overloads
Creates a color ramp with a single color.
The color is placed at the X-coordinate 0.0.
Creates a color ramp with two colors.
Shape
Creates a color ramp for drawing the interior and/or border of a shape.
Here are some common usage scenarios for this method:
-
ColorRamp.Shape()
Draw the shape with a single pixel black border and white fill (good for debug / test). -
ColorRamp.Shape(0)
Draw the shape without border and white fill (good for modulation / clip masks). -
ColorRamp.Shape(0,0,fill)
Draw the shape without border and the given fill color. -
ColorRamp.Shape(thickness,border,0)
Draw the shape with a border of the given thickness and color, without fill.
The returned color ramps contains four colors:
X | Y --------+-------- -h - e | fill -h | border +h | border +h + e | empty
where h is half of thickness opt, e is epsilon opt and empty is the same color as border opt (or fill opt if thickness opt is zero) with its alpha channel set to zero.