From 96198dae55b1429449504e49065a10763b288431 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 5 Jan 2023 19:25:45 +0100 Subject: Normalize color storage Colors are now normalized to 0 - 1 values instead of 0 - 255 causes calculations to be simpler and generally cleans up the codebase. --- src/managers/KeybindManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/managers/KeybindManager.cpp') diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 2eb93a2a..15ed348b 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -126,7 +126,7 @@ void CKeybindManager::updateXKBTranslationState() { if (!PKEYMAP) { g_pHyprError->queueCreate("[Runtime Error] Invalid keyboard layout passed. ( rules: " + RULES + ", model: " + MODEL + ", variant: " + VARIANT + ", options: " + OPTIONS + ", layout: " + LAYOUT + " )", - CColor(255, 50, 50, 255)); + CColor(1.0, 50.0 / 255.0, 50.0 / 255.0, 1.0)); Debug::log(ERR, "[XKBTranslationState] Keyboard layout %s with variant %s (rules: %s, model: %s, options: %s) couldn't have been loaded.", rules.layout, rules.variant, rules.rules, rules.model, rules.options); @@ -1017,10 +1017,10 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { PWORKSPACE->m_fAlpha.setValueAndWarp(0.f); POLDWORKSPACEIDRETURN->m_vRenderOffset.setValueAndWarp(Vector2D(0, 0)); - POLDWORKSPACEIDRETURN->m_fAlpha.setValueAndWarp(255.f); + POLDWORKSPACEIDRETURN->m_fAlpha.setValueAndWarp(1.f); POLDWORKSPACEONMON->m_vRenderOffset.setValueAndWarp(Vector2D(0, 0)); - POLDWORKSPACEONMON->m_fAlpha.setValueAndWarp(255.f); + POLDWORKSPACEONMON->m_fAlpha.setValueAndWarp(1.f); g_pEventManager->m_bIgnoreEvents = false; -- cgit v1.2.3