|
|
|
@@ -91,6 +91,7 @@ public: |
|
|
|
Colour colour2, Point<float> point2,
|
|
|
|
bool isRadial);
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Creates a vertical linear gradient between two Y coordinates */
|
|
|
|
static ColourGradient vertical (Colour colour1, float y1,
|
|
|
|
Colour colour2, float y2);
|
|
|
|
@@ -99,6 +100,20 @@ public: |
|
|
|
static ColourGradient horizontal (Colour colour1, float x1,
|
|
|
|
Colour colour2, float x2);
|
|
|
|
|
|
|
|
/** Creates a vertical linear gradient from top to bottom in a rectangle */
|
|
|
|
template <typename Type>
|
|
|
|
static ColourGradient vertical (Colour colourTop, Colour colourBottom, Rectangle<Type> area)
|
|
|
|
{
|
|
|
|
return vertical (colourTop, (float) area.getY(), colourBottom, (float) area.getBottom());
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Creates a horizontal linear gradient from right to left in a rectangle */
|
|
|
|
template <typename Type>
|
|
|
|
static ColourGradient horizontal (Colour colourLeft, Colour colourRight, Rectangle<Type> area)
|
|
|
|
{
|
|
|
|
return horizontal (colourLeft, (float) area.getX(), colourRight, (float) area.getRight());
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Destructor */
|
|
|
|
~ColourGradient();
|
|
|
|
|
|
|
|
@@ -121,8 +136,7 @@ public: |
|
|
|
@param colour the colour that should be used at this point
|
|
|
|
@returns the index at which the new point was added
|
|
|
|
*/
|
|
|
|
int addColour (double proportionAlongGradient,
|
|
|
|
Colour colour);
|
|
|
|
int addColour (double proportionAlongGradient, Colour colour);
|
|
|
|
|
|
|
|
/** Removes one of the colours from the gradient. */
|
|
|
|
void removeColour (int index);
|
|
|
|
@@ -194,9 +208,6 @@ private: |
|
|
|
//==============================================================================
|
|
|
|
struct ColourPoint
|
|
|
|
{
|
|
|
|
ColourPoint() noexcept {}
|
|
|
|
ColourPoint (double pos, Colour col) noexcept : position (pos), colour (col) {}
|
|
|
|
|
|
|
|
bool operator== (ColourPoint) const noexcept;
|
|
|
|
bool operator!= (ColourPoint) const noexcept;
|
|
|
|
|
|
|
|
|