Gradient

Colour Gradient class.

The colour gradient is defined by a list of colour stops where each stop specifies the colour at a given position along the gradient axis. It maintains a lookup table that is used by the rasterizer.

Constructors

this
this(int lookupLength)

Create an empty colour gradient, you can specify the size of the lookuptable

Destructor

~this
~this()

destructor

Members

Functions

addStop
Gradient addStop(float pos, uint color)

add a color stop, pos will be cliped to 0..1

getLookup
uint[] getLookup()

get lookup table, this can cause the lookup table to be recomputed if anything significant has changed.

initEqualSpaced
void initEqualSpaced(T args)

Initialises the gradient to a sequence of equaly spaced colours.

isOpaque
bool isOpaque()

is the gradient fully opaque?

length
uint length()

How many colour stops are there?

lookupLength
int lookupLength()

get lookup table length

reset
void reset()

reset the list of gradient colour stops to empty

setLookupLength
void setLookupLength(int len)

change lookup table length (8192 max)

Meta