added hsv stuff

This commit is contained in:
2024-05-18 13:58:54 +03:00
parent 7ea5cecff0
commit d435625757
2 changed files with 80 additions and 2 deletions

View File

@@ -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};}