4#ifndef MALENA_GRADIENTCOLORPICKER_H
5#define MALENA_GRADIENTCOLORPICKER_H
65 float _hueBarW = 22.f;
68 float _h = 0.f, _s = 1.f, _v = 1.f;
71 bool _prevMouseDown =
false;
72 bool _prevEnter =
false;
74 std::function<void(
const sf::Color&)> _onColorChanged;
75 std::function<void()> _onCommit;
void setPosition(const sf::Vector2f &pos) override
Set the world-space position immediately (no animation).
sf::FloatRect getGlobalBounds() const override
Return the axis-aligned bounding box in world space.
void setSize(const sf::Vector2f &size)
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
void onCommit(std::function< void()> cb)
static void rgbToHsv(const sf::Color &c, float &h, float &s, float &v)
void setColor(const sf::Color &c)
static sf::Color hsvToRgb(float h, float s, float v)
sf::Vector2f getPosition() const override
Return the current world-space position.
void onColorChanged(std::function< void(const sf::Color &)> cb)
sf::Vector2f getSize() const
Vector2< float > Vector2f