[nostalgia/gfx] Cleanup
All checks were successful
Build / build (push) Successful in 1m19s

This commit is contained in:
Gary Talent 2025-05-31 01:53:59 -05:00
parent 6b7c5d896e
commit e78c405046
2 changed files with 4 additions and 4 deletions

View File

@ -142,9 +142,9 @@ constexpr Color16 color16(int r, int g, int b, int a = 0) noexcept {
[[nodiscard]]
constexpr Color16 color16(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 0) noexcept {
return static_cast<Color16>(ox::min<uint8_t>(r, 31))
| static_cast<Color16>(ox::min<uint8_t>(g, 31) << 5)
| static_cast<Color16>(ox::min<uint8_t>(b, 31) << 10)
| static_cast<Color16>(a << 15);
| static_cast<Color16>(ox::min<uint8_t>(g, 31) << 5)
| static_cast<Color16>(ox::min<uint8_t>(b, 31) << 10)
| static_cast<Color16>(a << 15);
}
static_assert(color16(0, 31, 0) == 992);

View File

@ -311,7 +311,7 @@ void PaletteEditorImGui::drawColorEditor() noexcept {
{
ImGui::PushStyleColor(
ImGuiCol_ChildBg,
color32(color16(static_cast<uint8_t>(r), static_cast<uint8_t>(g), static_cast<uint8_t>(b))) | 0xff'00'00'00);
color32(color16(r, g, b)) | 0xff'00'00'00);
ImGui::BeginChild("ColorPreview", {0, 25});
ImGui::EndChild();
ImGui::PopStyleColor();