23 BEGIN_IGRAPHICS_NAMESPACE
45 const float v =
static_cast<float>(
GetValue() * 0.65f);
50 g.
DrawEllipse(COLOR_BLACK, innerPart,
nullptr, 1.f);
52 IBlend b = {EBlend::Default, v};
56 void TriggerWithDecay(
int decayTimeMs)
62 pControl->OnEndAnimation();
66 pControl->
SetValue(EaseCubicIn(1. -progress));
75 END_IGRAPHICS_NAMESPACE
The lowest level base class of an IGraphics control.
Used to manage a rectangular area, independent of draw class/platform.
Used to manage composite/blend operations, independent of draw class/platform.
Used to manage color data, independent of draw class/platform.
void GetHSLA(float &h, float &s, float &l, float &a) const
Get the Hue, Saturation and Luminance of the color.
This file contains the base IControl implementation, along with some base classes for specific types ...
static IPattern CreateRadialGradient(float x1, float y1, float r, const std::initializer_list< IColorStop > &stops={})
Create a radial gradient IPattern.
double GetAnimationProgress() const
Get the progress in a control's animation, in the range 0-1.
void PathEllipse(const IRECT &bounds)
Add an ellipse to the current path, specifying the rectangular region.
IRECT GetScaledAboutCentre(float scale) const
Get a copy of this IRECT where the width and height are multiplied by scale without changing the cent...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
virtual void PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
Fill the current current path.
The lowest level base class of an IGraphics context.
void SetAnimation(IAnimationFunction func)
Set the animation function.
virtual void FillEllipse(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill an ellipse within a rectangular region of the graphics context.
virtual void DrawEllipse(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)
Draw an ellipse within a rectangular region of the graphics context.
double GetValue(int valIdx=0) const
Get the control's value.
static IColor FromHSLA(float h, float s, float l, float a=1.f)
Create an IColor from Hue Saturation and Luminance values.
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
virtual void SetValue(double value, int valIdx=0)
Set one of the control's values.
void Draw(IGraphics &g) override
Draw the control to the graphics context.