UnityCommunity / UnityLibrary

:books: Library of all kind of scripts, snippets & shaders for Unity
https://unitycommunity.github.io/UnityLibrary/
MIT License
3.83k stars 446 forks source link

string.ToColor() #56

Closed wbm1113 closed 2 years ago

wbm1113 commented 2 years ago

What

Simple extension method to convert a string to a Color.

Why

Copying individual floats from the Unity editor to hard-code a color value is time consuming and annoying. With this, you can just copy the hex value out of the Unity editor and paste it into your script.

How

"#FFFFFF".ToColor()

unitycoder commented 2 years ago

thanks!