[nostalgia/core] Add applySelectionColor

This commit is contained in:
Gary Talent 2024-05-25 21:32:57 -05:00
parent 94c59604ee
commit 1f87216da4

View File

@ -152,4 +152,13 @@ static_assert(color16(16, 31, 0) == 1008);
static_assert(color16(16, 31, 8) == 9200);
static_assert(color16(16, 32, 8) == 9200);
[[nodiscard]]
constexpr Color16 applySelectionColor(Color16 const color) noexcept {
namespace core = nostalgia::core;
auto const r = core::red16(color) / 2;
auto const g = (core::green16(color) + 20) / 2;
auto const b = (core::blue16(color) + 31) / 2;
return core::color16(r, g, b);
}
}