+1 vote

With ColorN("black") you get 0,0,0,1.
Is it possible to invert this, so I can get the string name back?

in Engine by (225 points)

1 Answer

0 votes
Best answer

The var2str() and str2var() functions can be used to convert any Variant (including Color) to a string and back to the original Variant. However, Color8 and ColorN are different ways to create Colors, but they are not dedicated Variant types. This means you will get a Color instead of the ColorN with the string name.

by (12,795 points)
selected by

So there is currently no possible way to make 0,0.74902,1,1 to deepskyblue?

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.