refactor: some coloring tweaks
This commit is contained in:
@@ -29,6 +29,7 @@ namespace Reset.Core.Tools{
|
|||||||
public string pageNamePrefix = "Debug Page: ";
|
public string pageNamePrefix = "Debug Page: ";
|
||||||
|
|
||||||
private static float defaultLabelAlpha;
|
private static float defaultLabelAlpha;
|
||||||
|
private static float defaultValueAlpha;
|
||||||
|
|
||||||
// Private variables
|
// Private variables
|
||||||
[ShowInInspector]
|
[ShowInInspector]
|
||||||
@@ -55,7 +56,8 @@ namespace Reset.Core.Tools{
|
|||||||
|
|
||||||
Debug.Log(valueTemplate.Instantiate().resolvedStyle.backgroundColor);
|
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;
|
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 labelBG = Instance.values[$"{pageName}/{sourceName}"].parent.parent.Query<VisualElement>("LabelBackground").First();
|
||||||
VisualElement valueBG = Instance.values[$"{pageName}/{sourceName}"].parent.parent.Query<VisualElement>("ValueBackground").First();
|
VisualElement valueBG = Instance.values[$"{pageName}/{sourceName}"].parent.parent.Query<VisualElement>("ValueBackground").First();
|
||||||
|
|
||||||
labelBG.style.backgroundColor = (newColor * .7f).Alpha(labelBG.resolvedStyle.backgroundColor.a);
|
labelBG.style.backgroundColor = ((newColor / 1.2f + Color.gray * .3f)* .7f).Alpha(defaultLabelAlpha);
|
||||||
valueBG.style.backgroundColor = (newColor * .6f).Alpha(valueBG.resolvedStyle.backgroundColor.a);
|
valueBG.style.backgroundColor = ((newColor / 1.5f + Color.gray * .4f) * .6f) .Alpha(defaultValueAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Back a page
|
// Back a page
|
||||||
|
|||||||
Reference in New Issue
Block a user