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.
This commit is contained in:
vaxerski
2023-01-05 19:25:45 +01:00
parent 0e3547e0f6
commit 96198dae55
18 changed files with 71 additions and 72 deletions

View File

@@ -387,7 +387,7 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s
}
try {
data->m_vColors.push_back(CColor(configStringToInt(var)) * (1.f / 255.f));
data->m_vColors.push_back(CColor(configStringToInt(var)));
} catch (std::exception& e) {
Debug::log(WARN, "Error reading value of %s", COMMAND.c_str());
parseError = "Error setting value <" + VALUE + "> for field <" + COMMAND + ">. " + e.what();
@@ -1247,10 +1247,10 @@ void CConfigManager::loadConfigLoadVars() {
// parseError will be displayed next frame
if (parseError != "")
g_pHyprError->queueCreate(parseError + "\nHyprland may not work correctly.", CColor(255, 50, 50, 255));
g_pHyprError->queueCreate(parseError + "\nHyprland may not work correctly.", CColor(1.0, 50.0 / 255.0, 50.0 / 255.0, 1.0));
else if (configValues["autogenerated"].intValue == 1)
g_pHyprError->queueCreate("Warning: You're using an autogenerated config! (config file: " + CONFIGPATH + " )\nSUPER+Q -> kitty\nSUPER+M -> exit Hyprland",
CColor(255, 255, 70, 255));
CColor(1.0, 1.0, 70.0 / 255.0, 1.0));
else
g_pHyprError->destroy();