Last active
January 16, 2019 23:06
-
-
Save beardordie/f2b005a844329734e6b944041ec1ce1c to your computer and use it in GitHub Desktop.
Unity - Code Snippet to convert a Color value to an RGB hex value
This file contains hidden or 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
// this is not a full class, just a code snippet showing the relevant method to convert a Color object | |
// to an RGB hex value so it can be used in a text field | |
public Color playerColor; | |
public Text playerTextField; | |
playerTextField.text = "<color=#" + ColorUtility.ToHtmlStringRGB(playerColor) + ">PLAYER</color>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment