IColorRamp

Description

interface Tinman.Terrain.Util.IColorRamp

Base interface for classes that provide a color ramp.

A color ramp maps input coordinates within a specific range (see Range) to color values:

     Start   End
<------X======X------>   input coordinates
A______/      \______B   constant colors
       \______/          interpolated colors

The color values outside the range are always constant (but not necessarily the same). This interface does not specify how color values inside the range are computed, only that it must be possible to produce a color value for any input coordinate.

Public / Methods

Get

2 overloads


[Pure]
public method Get1 → (1)

in : float64

Coordinate of color to return.

returns → int64

The color value.

Returns the color for a point on this color ramp.


[Pure]
public method Get2 → (2)

x0 in : float64

Lower interval coordinate of color to return.

x1 in : float64

Upper interval coordinate of color to return.

returns → int64

The color value.

Returns the color for an interval on this color ramp.

Modulate


public method Modulate → (1)

color in : int64

The color to modulate with.

returns → IColorRamp

The resulting color ramp.

Modulates the colors in this color ramp.

Transform


public method Transform → (2)

offset in : float64

Offset value to add to scaled input X-coordinates.

scale opt : float64 = 1

Scale factor to apply to input X-coordinates.

returns → IColorRamp

The resulting color ramp.

Transforms the input coordinate of this color ramp.

Input X-coordinates are transformed as follows:

xOut = offset + scale * xIn
xIn  = (xOut - offset) / scale
     = xOut / scale - offset / scale

where xIn refers to the coordinate passed to the returned color ramp and xOut is the coordinate that is passed to this color ramp.

Public / Attributes

Range


public attribute Range → (get)

value : RangeD

The coordinate range.

Returns the coordinate range of this color ramp.

Extensions

To​Color​Buffer

2 overloads


public static method ToColorBuffer1 → (1)

opt : int32 = 256

[>0]
The number of palette colors.

returns → ColorBuffer

The created color buffer.

Converts this color ramp into a color buffer with a height of one.

See also

IColorRamp.Range


public static method ToColorBuffer2 → (3)

x1 in : float64

X-coordinate of first palette color.

x2 in : float64

X-coordinate of last palette color.

opt : int32 = 256

[>0]
The number of palette colors.

returns → ColorBuffer

The created color buffer.

Converts this color ramp into a color buffer with a height of one.

To​Color​Palette

2 overloads


public static method ToColorPalette1 → (1)

opt : int32 = 256

[>0]
The number of palette colors.

returns → int64 [ ]

The created color palette.

Converts this color ramp into a color palette.

See also

IColorRamp.Range


public static method ToColorPalette2 → (3)

x1 in : float64

X-coordinate of first palette color.

x2 in : float64

X-coordinate of last palette color.

opt : int32 = 256

[>0]
The number of palette colors.

returns → int64 [ ]

The created color palette.

Converts this color ramp into a color palette.