1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:07:36 +00:00

AK: Add mix

This commit is contained in:
Jelle Raaijmakers 2022-01-04 15:01:25 +01:00 committed by Linus Groh
parent 10efbfb09e
commit 8da0925d6d
2 changed files with 21 additions and 0 deletions

View file

@ -91,6 +91,12 @@ constexpr T clamp(const T& value, const IdentityType<T>& min, const IdentityType
return value;
}
template<typename T, typename U>
constexpr T mix(T const& v1, T const& v2, U const& interpolation)
{
return v1 + (v2 - v1) * interpolation;
}
template<typename T, typename U>
constexpr T ceil_div(T a, U b)
{
@ -167,6 +173,7 @@ using AK::exchange;
using AK::is_constant_evaluated;
using AK::max;
using AK::min;
using AK::mix;
using AK::RawPtr;
using AK::swap;
using AK::to_underlying;