ColorRamp

Description

sealed class Tinman.Terrain.Util.ColorRamp

Derived from

ColorRampBase abstract

This class represents a color ramp.

A color ramp consists of one or more color ramp slots; each slot holds an X-coordinate and a color value.

Public / Constants

Earth


[ShutdownSurvive]
public static readonly attribute Earth → (IColorRamp)

A color ramp for Earth with intuitive colors.

Use ellipsoid/geoid heights as input for the color ramp: -1000m .. 8000m.

Mars


[ShutdownSurvive]
public static readonly attribute Mars → (IColorRamp)

A rainbow color ramp for Mars.

Use areoid heights as input for the color ramp: -7500m .. 15000m.

Moon


[ShutdownSurvive]
public static readonly attribute Moon → (IColorRamp)

A rainbow color ramp for the Moon.

Use reference sphere heights as input for the color ramp: -9000m .. 10000m.

Outline


[ShutdownSurvive]
public static readonly attribute Outline → (IColorRamp)

Default color ramp for outlines.

The outline color ramp looks like this:

 X | Y
---+------------------
-1 | opaque white
 0 | opaque gray
+1 | transparent gray

Planet


[ShutdownSurvive]
public static readonly attribute Planet → (IColorRamp)

A rainbow color ramp for a planet.

Use normalized heights as input for the color ramp: -1 .. +1.

Pluto


[ShutdownSurvive]
public static readonly attribute Pluto → (IColorRamp)

A rainbow color ramp for Pluto.

Use reference sphere heights as input for the color ramp: -3000m .. 4000m.

Public / Constructors

ColorRamp

2 overloads


public constructor ColorRamp1 → ()

Creates a new instance of ColorRamp.


public constructor ColorRamp2 → (1)

initialCapacity in : int32

[>=0]
The initial capacity of the color ramp.

Creates a new instance of ColorRamp.

ForColor


public static method ForColor → (1)

color in : int64

The color ramp color.

returns → IColorRamp

The created ColorRamp.

Creates a color ramp with a single color.

The color is placed at the X-coordinate 0.0.

ForColors


public static method ForColors → (4)

colorA in : int64

The first color ramp color.

colorB in : int64

The second color ramp color.

coordA opt : float64 = 0

Coordinate of colorA in.

coordB opt : float64 = 1

Coordinate of colorB in.

returns → IColorRamp

The created ColorRamp.

Creates a color ramp with two colors.

ForInterior


public static method ForInterior → (1)

inside opt : int64 = Colors.White

The inside color.

returns → IColorRamp

The created ColorRamp.

Creates a color ramp with two colors for interior rendering.

The returned color ramps contains two colors:

 X | Y
---+--------
 0 | inside
+1 | outside

where outside is the same color as inside opt with its alpha channel set to zero.

ForOutline


public static method ForOutline → (2)

inside opt : int64 = Colors.White

The inside color.

border opt : int64 = Colors.DimGray

The border color.

returns → IColorRamp

The created ColorRamp.

Creates a color ramp with three colors for outline rendering.

The returned color ramps contains these colors:

 X | Y
---+--------
-1 | inside
 0 | border
+1 | outside

where outside is the same color as border opt with its alpha channel set to zero.

ForRange


public static method ForRange → (2)

range in : VerticalRange

The vertical range, in the given unit opt.

unit opt : UnitOfMeasure = null

The vertical unit. If null, UnitOfMeasure.Metre is used.

returns → IColorRamp

The default color ramp, using vertical coordinates in unit opt as input.

Returns a default color ramp for the given vertical range.

Rainbow


public static method Rainbow → (2)

minimum in : float64

The minimum input value of the color ramp. Will be mapped to violet/blue.

maximum in : float64

The maximum input value of the color ramp. Will be mapped to red/white.

returns → IColorRamp

The rainbow color ramp.

Creates a rainbow-like color ramp.

Public / Methods

Add


public method Add → (2)

coordinate in : float64

Coordinate of color ramp slot.

color in : int64

Color value of color ramp slot (see Colors).

returns → ColorRamp

this

Adds a color on this color ramp.

The color ramp slots must be set so that the following condition is met:

x[i] >= x[i-1]

The X-coordinate of a color ramp slot must be greater than or equal to the X-coordinate of the preceding slot.

Set


public method Set → (3)

idx in : int32

[>=0]
Index of color ramp slot.

coordinate in : float64

Coordinate of color ramp slot.

color in : int64

Color value of color ramp slot (see Colors).

returns → ColorRamp

this

Sets a color on this color ramp.

The color ramp slots must be set so that the following condition is met:

x[i] >= x[i-1]

The X-coordinate of a color ramp slot must be greater than or equal to the X-coordinate of the preceding slot.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<IColorRamp>

[not-null]
The configurator object.

The configurator object for this type.

Serialization

SerialId


public static readonly attribute SerialId → (ISerialTypeInfo)

Serialization information about this type.