ColorRamp Object

Use this to change the color order for the color-by-value field plots.

Methods

Reset

Resets internal settings to defaults.

 

Type ( enum ramptype )

Sets the color ramp to a predefined or user-defined color order.

enum ramptype

color order

"Rainbow"

blue-cyan-green-yellow-red (default)

"Fire"

cyan-blue-magenta-red-yellow

"Inspire"

green-blue-magenta-red-yellow

"FarFire"

blue-magenta-red-yellow (for far fields)

"Gray"

for black-and-white printer

"Phase"

red-magenta-blue-cyan-green-yellow-red

"Free"

user defined, see .AddPoint method

 

Invert ( bool switch )

Inverts the color order, e.g. turn the rainbow type to red-yellow-green-cyan-blue.

 

Scaling ( enum scaletype )

Stretches or squeezes the color ramp.

enum scaletype

meaning

result for rainbow type

"None"

The color ramp is neither squeezed nor stretched.

blue-cyan-green-yellow-red

"Stretch"

The range 0..max is stretched to -max..max.

green-yellow-red

"Squeeze"

The range -max..max is squeezed to 0..max and inverted to -max..0.

red-yellow-green-cyan-blue-cyan-green-yellow-red

 

NumberOfContourValues ( int number )

Changes the number of contour values. The number must be greater 2, numbers greater 99 are not recommended for normal use. A higher value results in a smoother coloring.

 

GetNumberOfContourValues long

Returns the number of contour values.

 

DrawContourLines ( bool switch )

Outline the contour values with black lines between the color steps. Does only apply for 2D / 3D contour plots and 3D farfield plots.

 

AddPoint ( double value, double red, double green, double blue )

A user defined color ramp is shown for .Type "Free". For any field value in the range from -1 (minimum) to +1 (maximum), the desired color can be defined by three doubles ranging from 0 to 1. The color values between two adjacent points will be interpolated. At least two color definitions are needed. See Example.

Style (enum {"None" / "Horizontal" / "Vertical"} )

This switch either hides (None) the color ramp or positions it horizontally or vertically in the main view.

Default Settings

Type ("rainbow")

Invert (False)

Scaling ("None")

NumberOfContourValues (17)

DrawContourLines (False)

Example

The following example will result in a color order white - magenta - dark magenta - magenta - white.

 

With ColorRamp

.Reset

.Scaling ("Squeeze")

.AddPoint (-1, 0.5, 0, 0.5)

.AddPoint (0, 1, 0, 1)

.AddPoint (1, 1, 1, 1)

.NumberOfContourValues 33

.Type ("Free")

End With