Add lerp for generic_color
This commit is contained in:
parent
ea13bba49a
commit
4d9b8dde29
1 changed files with 6 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <psemek/geom/vector.hpp>
|
#include <psemek/geom/vector.hpp>
|
||||||
#include <psemek/geom/interval.hpp>
|
#include <psemek/geom/interval.hpp>
|
||||||
|
#include <psemek/geom/math.hpp>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
|
@ -83,6 +84,11 @@ namespace psemek::gfx
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline generic_color lerp(generic_color const & c0, generic_color const & c1, float t)
|
||||||
|
{
|
||||||
|
return generic_color{geom::lerp(c0.c, c1.c, t)};
|
||||||
|
}
|
||||||
|
|
||||||
static const generic_color white {{1.f, 1.f, 1.f, 1.f}};
|
static const generic_color white {{1.f, 1.f, 1.f, 1.f}};
|
||||||
static const generic_color black {{0.f, 0.f, 0.f, 1.f}};
|
static const generic_color black {{0.f, 0.f, 0.f, 1.f}};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue