diff --git a/include/uml/color.h b/include/uml/color.h index 4ed01b2..c1b8019 100644 --- a/include/uml/color.h +++ b/include/uml/color.h @@ -3,11 +3,20 @@ // #pragma once + #include "uml/Vector3.h" #include +#include "uml/Vector4.h" + namespace uml::color { [[nodiscard]] Vector3 Blend(const Vector3& first, const Vector3& second, float ratio); + + class Color : public Vector4 + { + public: + [[nodiscard]] Color Blend(const Color& other, float ratio) const; + }; } \ No newline at end of file diff --git a/source/color.cpp b/source/color.cpp index 89f082d..4b54361 100644 --- a/source/color.cpp +++ b/source/color.cpp @@ -3,11 +3,17 @@ // #include "uml/color.h" +#include namespace uml::color { - Vector3 Blend(const uml::Vector3 &first, const uml::Vector3 &second, float ratio) + Vector3 Blend(const Vector3 &first, const Vector3 &second, float ratio) { - return first * (1.f - ratio) + second * ratio; + return first * (1.f - std::clamp(ratio, 0.f, 1.f)) + second * ratio; + } + + Color Color::Blend(const Color &other, float ratio) const + { + } } \ No newline at end of file