ColourScales Commands

ColourScales Commands

Define colourscales to colour objects. Each colourscale has a number of points defining colours at specific values - between adjacent points the colour is linearly interpolated. Points in a colourscale are numbered from 1 onwards. There are ten available colourscales, with IDs 1-10. Some of these have specific uses within Aten.

[Note]See also:
  • Colourscales for a discussion of colourscales and how they may be used within Aten.

addpoint

Syntax:

void addpoint(scaleid,  
 value,  
 r,  
 g,  
 b,  
 a = 1.0); 
int  scaleid;
double  value;
double  r;
double  g;
double  b;
double  a = 1.0;

Adds a new point to the end of the specified colourscale, at the point value and with the RGB[A] colour provided.

For example:

addpoint(1, 15.0, 0.0, 1.0, 0.0);

adds a point to colourscale 1 at a value of 15.0 in a nasty green colour.

clearpoints

Syntax:

void clearpoints(scaleid); 
int  scaleid;

Clears all points from the specified colourscale.

For example:

clearpoints(3);

clears all points from the third colourscale.

listscales

Syntax:

void listscales(); 

Lists the current types, colours, and ranges of the colourscales

For example:

listscales();

removepoint

Syntax:

void removepoint(scaleid,  
 pointid); 
int  scaleid;
int  pointid;

Remove a single point from the selected colourscale.

For example:

removepoint(1,4);

deletes the fourth point from colourscale 1.

scalename

Syntax:

string scalename(scaleid); 
int  scaleid;
string scalename(scaleid,  
 newname); 
int  scaleid;
string  newname;

Retrieves the name of the colourscale id provided, or sets the name if a new name is provided). The name is displayed next to the gradient bar (if drawn).

For example:

scalename(1, "Orientation");

renames the first colourscale to 'Orientation'.

scalevisible

Syntax:

void scalevisible(scaleid,  
 visible); 
int  scaleid;
bool  visible;

Sets whether the gradient bar for the specified colourscale should be drawn in the main view. Default is 'off' for all colourscales.

For example:

scalevisible(9, "yes");

draws the gradient bar for the 9th colourscale in the main view.

setpoint

Syntax:

void setpoint(scaleid,  
 pointid,  
 value,  
 r,  
 g,  
 b,  
 a = 1.0); 
int  scaleid;
int  pointid;
double  value;
double  r;
double  g;
double  b;
double  a = 1.0;

Sets the value and colour of an existing point in the specified colourscale.

For example:

setpoint(1, 2, -3.3, 1.0, 1.0, 1.0);

sets the second point on colourscale 1 to a value of -3.3 and white colour.

setpointcolour

Syntax:

void setpointcolour(scaleid,  
 pointid,  
 r,  
 g,  
 b,  
 a = 1.0); 
int  scaleid;
int  pointid;
double  r;
double  g;
double  b;
double  a = 1.0;

Sets the colour of an existing point in the specified colourscale.

For example:

setpointcolour(5, 1, 0.0, 0.0, 1.0);

sets the first point on colourscale 5 to be coloured blue.

setpointvalue

Syntax:

void setpointvalue(scaleid,  
 pointid,  
 value); 
int  scaleid;
int  pointid;
double  value;

Sets the value of an existing point in the specified colourscale.

For example:

setpointvalue(4, 3, 0.1);

sets the third point of colourscale 4 to a value of 0.1.