diff --git a/include/uml/color.h b/include/uml/color.h new file mode 100644 index 0000000..4ed01b2 --- /dev/null +++ b/include/uml/color.h @@ -0,0 +1,13 @@ +// +// Created by vlad on 2/4/24. +// + +#pragma once +#include "uml/Vector3.h" +#include + +namespace uml::color +{ + [[nodiscard]] + Vector3 Blend(const Vector3& first, const Vector3& second, float ratio); +} \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 810521a..7b64eb9 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -2,4 +2,5 @@ target_sources(uml PRIVATE Vector3.cpp matrix.cpp angles.cpp - ProjectilePredictor.cpp) \ No newline at end of file + ProjectilePredictor.cpp + color.cpp) \ No newline at end of file diff --git a/source/color.cpp b/source/color.cpp new file mode 100644 index 0000000..89f082d --- /dev/null +++ b/source/color.cpp @@ -0,0 +1,13 @@ +// +// Created by vlad on 2/4/24. +// + +#include "uml/color.h" + +namespace uml::color +{ + Vector3 Blend(const uml::Vector3 &first, const uml::Vector3 &second, float ratio) + { + return first * (1.f - ratio) + second * ratio; + } +} \ No newline at end of file