mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added hsv stuff
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
|
||||
namespace uml::color
|
||||
{
|
||||
struct HSV
|
||||
{
|
||||
float m_hue{};
|
||||
float m_saturation{};
|
||||
float m_value{};
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3 Blend(const Vector3& first, const Vector3& second, float ratio);
|
||||
|
||||
@@ -18,9 +25,20 @@ namespace uml::color
|
||||
{
|
||||
public:
|
||||
Color(float r, float g, float b, float a);
|
||||
|
||||
[[nodiscard]]
|
||||
static Color FromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
||||
|
||||
[[nodiscard]]
|
||||
static Color FromHSV(float hue, float saturation, float value);
|
||||
|
||||
[[nodiscard]]
|
||||
HSV ToHSV() const;
|
||||
|
||||
explicit Color(Vector4 vec);
|
||||
[[nodiscard]] Color Blend(const Color& other, float ratio) const;
|
||||
|
||||
[[nodiscard]]
|
||||
Color Blend(const Color& other, float ratio) const;
|
||||
|
||||
[[nodiscard]] static Color Red() {return {1.f, 0.f, 0.f, 1.f};}
|
||||
[[nodiscard]] static Color Green() {return {0.f, 1.f, 0.f, 1.f};}
|
||||
|
||||
Reference in New Issue
Block a user