Feb
18
2020

Debug.Log: Show actual color from Color variable

Had to debug what color is the script returning for mouse pixel position, but printing out the value didn’t really help:
Debug.Log(col);
Since the output is like this (you don’t know whats the actual color)
RGBA(0,349, 0,204, 0,416, 0,000)
Enter Debug.Log with <color></color> and utf8 block:
Debug.Log("<color=#"+ColorUtility.ToHtmlStringRGB(col)+">██████████</color> = "+col);

Using Debug.Log with <color> to display color variable value

Snippet, if copying from blog is messed up:
https://gist.github.com/unitycoder/37872953bd27901391ed0b27d4702e9c


Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch Instagram

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.