refactor: some coloring tweaks

This commit is contained in:
Chris
2025-08-26 13:35:53 -04:00
parent 4afb769d06
commit b1b8a5b957

View File

@@ -29,6 +29,7 @@ namespace Reset.Core.Tools{
public string pageNamePrefix = "Debug Page: ";
private static float defaultLabelAlpha;
private static float defaultValueAlpha;
// Private variables
[ShowInInspector]
@@ -55,7 +56,8 @@ namespace Reset.Core.Tools{
Debug.Log(valueTemplate.Instantiate().resolvedStyle.backgroundColor);
defaultLabelAlpha = valueTemplate.Instantiate().style.backgroundColor.value.a;
defaultLabelAlpha = valueTemplate.Instantiate().Query<VisualElement>("LabelBackground").First().resolvedStyle.backgroundColor.a;
defaultValueAlpha = valueTemplate.Instantiate().Query<VisualElement>("ValueBackground").First().resolvedStyle.backgroundColor.a;
}
public static DebugOverlayDrawer Instance;
@@ -139,8 +141,8 @@ namespace Reset.Core.Tools{
VisualElement labelBG = Instance.values[$"{pageName}/{sourceName}"].parent.parent.Query<VisualElement>("LabelBackground").First();
VisualElement valueBG = Instance.values[$"{pageName}/{sourceName}"].parent.parent.Query<VisualElement>("ValueBackground").First();
labelBG.style.backgroundColor = (newColor * .7f).Alpha(labelBG.resolvedStyle.backgroundColor.a);
valueBG.style.backgroundColor = (newColor * .6f).Alpha(valueBG.resolvedStyle.backgroundColor.a);
labelBG.style.backgroundColor = ((newColor / 1.2f + Color.gray * .3f)* .7f).Alpha(defaultLabelAlpha);
valueBG.style.backgroundColor = ((newColor / 1.5f + Color.gray * .4f) * .6f) .Alpha(defaultValueAlpha);
}
// Back a page