This commit is contained in:
parent
6b7c5d896e
commit
e78c405046
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user