Describes the layout and colours that should be used to paint a colour gradient.
More...
|
| ColourGradient () noexcept |
| Creates an uninitialised gradient. More...
|
|
| ColourGradient (Colour colour1, float x1, float y1, Colour colour2, float x2, float y2, bool isRadial) |
| Creates a gradient object. More...
|
|
| ColourGradient (Colour colour1, Point< float > point1, Colour colour2, Point< float > point2, bool isRadial) |
| Creates a gradient object. More...
|
|
| ColourGradient (ColourGradient &&) noexcept |
|
| ColourGradient (const ColourGradient &) |
|
| ~ColourGradient () |
| Destructor. More...
|
|
int | addColour (double proportionAlongGradient, Colour colour) |
| Adds a colour at a point along the length of the gradient. More...
|
|
void | clearColours () |
| Removes any colours that have been added. More...
|
|
int | createLookupTable (const AffineTransform &transform, HeapBlock< PixelARGB > &resultLookupTable) const |
| Creates a set of interpolated premultiplied ARGB values. More...
|
|
void | createLookupTable (PixelARGB *resultLookupTable, int numEntries) const noexcept |
| Creates a set of interpolated premultiplied ARGB values. More...
|
|
Colour | getColour (int index) const noexcept |
| Returns the colour that was added with a given index. More...
|
|
Colour | getColourAtPosition (double position) const noexcept |
| Returns the an interpolated colour at any position along the gradient. More...
|
|
double | getColourPosition (int index) const noexcept |
| Returns the position along the length of the gradient of the colour with this index. More...
|
|
int | getNumColours () const noexcept |
| Returns the number of colour-stops that have been added. More...
|
|
bool | isInvisible () const noexcept |
| Returns true if all colours are completely transparent. More...
|
|
bool | isOpaque () const noexcept |
| Returns true if all colours are opaque. More...
|
|
void | multiplyOpacity (float multiplier) noexcept |
| Multiplies the alpha value of all the colours by the given scale factor. More...
|
|
bool | operator!= (const ColourGradient &) const noexcept |
|
ColourGradient & | operator= (ColourGradient &&) noexcept |
|
ColourGradient & | operator= (const ColourGradient &) |
|
bool | operator== (const ColourGradient &) const noexcept |
|
void | removeColour (int index) |
| Removes one of the colours from the gradient. More...
|
|
void | setColour (int index, Colour newColour) noexcept |
| Changes the colour at a given index. More...
|
|
|
static ColourGradient | horizontal (Colour colour1, float x1, Colour colour2, float x2) |
| Creates a horizontal linear gradient between two X coordinates. More...
|
|
template<typename Type > |
static ColourGradient | horizontal (Colour colourLeft, Colour colourRight, Rectangle< Type > area) |
| Creates a horizontal linear gradient from right to left in a rectangle. More...
|
|
static ColourGradient | vertical (Colour colour1, float y1, Colour colour2, float y2) |
| Creates a vertical linear gradient between two Y coordinates. More...
|
|
template<typename Type > |
static ColourGradient | vertical (Colour colourTop, Colour colourBottom, Rectangle< Type > area) |
| Creates a vertical linear gradient from top to bottom in a rectangle. More...
|
|
Describes the layout and colours that should be used to paint a colour gradient.
- See also
- Graphics::setGradientFill
@tags{Graphics}
Creates a gradient object.
(x1, y1) is the location to draw with colour1. Likewise (x2, y2) is where colour2 should be. In between them there's a gradient.
If isRadial is true, the colours form a circular gradient with (x1, y1) at its centre.
The alpha transparencies of the colours are used, so note that if you blend from transparent to a solid colour, the RGB of the transparent colour will become visible in parts of the gradient. e.g. blending from Colour::transparentBlack to Colours::white will produce a muddy grey colour midway, but Colour::transparentWhite to Colours::white will be white all the way across.
- See also
- ColourGradient
Creates a gradient object.
point1 is the location to draw with colour1. Likewise point2 is where colour2 should be. In between them there's a gradient.
If isRadial is true, the colours form a circular gradient with point1 at its centre.
The alpha transparencies of the colours are used, so note that if you blend from transparent to a solid colour, the RGB of the transparent colour will become visible in parts of the gradient. e.g. blending from Colour::transparentBlack to Colours::white will produce a muddy grey colour midway, but Colour::transparentWhite to Colours::white will be white all the way across.
- See also
- ColourGradient