Describes the layout and colours that should be used to paint a colour gradient.
More...
|
| ColourGradient () noexcept |
| Creates an uninitialised gradient.
|
|
| ColourGradient (const ColourGradient &) |
|
| ColourGradient (ColourGradient &&) noexcept |
|
ColourGradient & | operator= (const ColourGradient &) |
|
ColourGradient & | operator= (ColourGradient &&) noexcept |
|
| ColourGradient (Colour colour1, float x1, float y1, Colour colour2, float x2, float y2, bool isRadial) |
| Creates a gradient object.
|
|
| ColourGradient (Colour colour1, Point< float > point1, Colour colour2, Point< float > point2, bool isRadial) |
| Creates a gradient object.
|
|
void | clearColours () |
| Removes any colours that have been added.
|
|
int | addColour (double proportionAlongGradient, Colour colour) |
| Adds a colour at a point along the length of the gradient.
|
|
void | removeColour (int index) |
| Removes one of the colours from the gradient.
|
|
void | multiplyOpacity (float multiplier) noexcept |
| Multiplies the alpha value of all the colours by the given scale factor.
|
|
int | getNumColours () const noexcept |
| Returns the number of colour-stops that have been added.
|
|
double | getColourPosition (int index) const noexcept |
| Returns the position along the length of the gradient of the colour with this index.
|
|
Colour | getColour (int index) const noexcept |
| Returns the colour that was added with a given index.
|
|
void | setColour (int index, Colour newColour) noexcept |
| Changes the colour at a given index.
|
|
Colour | getColourAtPosition (double position) const noexcept |
| Returns the an interpolated colour at any position along the gradient.
|
|
int | createLookupTable (const AffineTransform &transform, HeapBlock< PixelARGB > &resultLookupTable) const |
| Creates a set of interpolated premultiplied ARGB values.
|
|
void | createLookupTable (PixelARGB *resultLookupTable, int numEntries) const noexcept |
| Creates a set of interpolated premultiplied ARGB values.
|
|
template<size_t NumEntries> |
void | createLookupTable (PixelARGB(&resultLookupTable)[NumEntries]) const noexcept |
| Creates a set of interpolated premultiplied ARGB values.
|
|
bool | isOpaque () const noexcept |
| Returns true if all colours are opaque.
|
|
bool | isInvisible () const noexcept |
| Returns true if all colours are completely transparent.
|
|
bool | operator== (const ColourGradient &) const noexcept |
|
bool | operator!= (const ColourGradient &) const noexcept |
|
bool | operator< (const ColourGradient &) const noexcept |
| This comparison, and the other ordered comparisons are provided only for compatibility with ordered container types like std::set and std::map.
|
|
bool | operator<= (const ColourGradient &) const noexcept |
|
bool | operator> (const ColourGradient &) const noexcept |
|
bool | operator>= (const ColourGradient &) const noexcept |
|
|
static ColourGradient | vertical (Colour colour1, float y1, Colour colour2, float y2) |
| Creates a vertical linear gradient between two Y coordinates.
|
|
static ColourGradient | horizontal (Colour colour1, float x1, Colour colour2, float x2) |
| Creates a horizontal linear gradient between two X coordinates.
|
|
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.
|
|
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.
|
|
Describes the layout and colours that should be used to paint a colour gradient.
- See also
- Graphics::setGradientFill
ColourGradient::ColourGradient |
( |
Colour | colour1, |
|
|
float | x1, |
|
|
float | y1, |
|
|
Colour | colour2, |
|
|
float | x2, |
|
|
float | y2, |
|
|
bool | isRadial ) |
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
ColourGradient::ColourGradient |
( |
Colour | colour1, |
|
|
Point< float > | point1, |
|
|
Colour | colour2, |
|
|
Point< float > | point2, |
|
|
bool | isRadial ) |
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