Last active
April 14, 2023 01:55
-
-
Save Rovsau/c20f486b0de831dc96f96793c645ea89 to your computer and use it in GitHub Desktop.
Debug logs with any range of color.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DebugColors | |
{ | |
public static void Log(Color color, string message, UnityEngine.Object context = default) | |
{ | |
UnityEngine.Debug.Log($"<color={ColorToHex(color)}>{message}</color>", context); | |
} | |
public static string ColorToHex(Color32 color) | |
{ | |
return $"#{color.r:X2}{color.g:X2}{color.b:X2}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment