Original (English)

color (var Value, int Color1, int Color2, int Color3, int Color4) : int

Returns the color corresponding to a position within a range of up to 4 colors; used for plotting heatmaps or multiple curves.

Parameters:

Value The color position within the range in percent; from 0 for Color1 until 100 for Color4.
Color1..Color4 The color range, starting with Color1 and ending with Color4. For 2-color or 3-color ranges, Color3 and Color4 can be omitted. See Colors for the color format.

Returns

Color within the range

colorScale (int Color, var Scale) : int

Returns the color multiplied with a scaling factor.

Parameters:

Color The color to be scaled.
Scale The scaling factor in percent, < 100 for reducing the brightness and > 100 for increasing it.

Returns

Color * Factor.

Remarks:

  • color(Value, WHITE, BLACK) produces a greyscale.
  • colorScale(Color, 110) increases the brightness of Color by 10%.
     

Example:

for(i=0; i<N; i++)
  for(j=0; j<N; j++)
    plotGraph("Heatmap", j+1, -i-1, SQUARE, color(Correlations[i][j]*100, BLUE, RED));

See also:

plot, panel, Colors

► latest version online

Übersetzung (Deutsch)

color (var Value, int Color1, int Color2, int Color3, int Color4) : int

Gibt die Farbe zurück, die einer Position innerhalb eines Bereichs von bis zu 4 Farben entspricht; verwendet für das Plotten von Heatmaps oder mehreren Kurven.

Parameter:

Value Die Farbposition innerhalb des Bereichs in Prozent; von 0 für Color1 bis 100 für Color4.
Color1..Color4 Der Farbbereich, beginnend mit Color1 und endend mit Color4. Für 2-Farben- oder 3-Farben-Bereiche können Color3 und Color4 weggelassen werden. Siehe Colors für das Farbformat.

Rückgabewerte

Farbe innerhalb des Bereichs

colorScale (int Color, var Scale) : int

Gibt die Farbe zurück, multipliziert mit einem Skalierungsfaktor.

Parameter:

Color Die Farbe, die skaliert werden soll.
Scale Der Skalierungsfaktor in Prozent, < 100 zur Reduzierung der Helligkeit und > 100 zur Erhöhung der Helligkeit.

Rückgabewerte

Color * Factor.

Bemerkungen:

  • color(Value, WHITE, BLACK) erzeugt eine Graustufenanzeige.
  • colorScale(Color, 110) erhöht die Helligkeit von Color um 10%.
     

Beispiel:

for(i=0; i<N; i++)
  for(j=0; j<N; j++)
    plotGraph("Heatmap", j+1, -i-1, SQUARE, color(Correlations[i][j]*100, BLUE, RED));

Siehe auch:

plot, panel, Colors

► latest version online