refactor: some coloring tweaks
This commit is contained in:
@@ -29,7 +29,8 @@ namespace Reset.Core.Tools{
|
||||
public string pageNamePrefix = "Debug Page: ";
|
||||
|
||||
private static float defaultLabelAlpha;
|
||||
|
||||
private static float defaultValueAlpha;
|
||||
|
||||
// Private variables
|
||||
[ShowInInspector]
|
||||
public KeyValuePair<GameObject, List<string>> currentPage;
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user