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);
Snippet, if copying from blog is messed up:
https://gist.github.com/unitycoder/37872953bd27901391ed0b27d4702e9c
Related Posts
Leave a comment
Recent posts
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)