Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: westingtyler on August 14, 2018, 11:16:22 PM
-
Hello. I need this. I know that 'Set Hex Color' is an action, but I need one to GET it from a color variable. Thank you!
Basically, my FSM has color variables you can set, then at runtime it needs to build the tags and instert them into strings, to display the colors in a Text Mesh Pro.
-
Unity has a neat function for that called ToHtmlStringRGBA, so i might make an action, but i will be unable to in the next following days.
-
No need for action actually. Here you go.
(https://s26.postimg.cc/t5zym1ai1/screenshot_195.png)
If you need # before the string, use build string to add it. If you need only RGB without alpha, omit A from method name.
-
Ah very nice!
But... you coded. :'(
-
Tested the TryParseHtmlString (https://docs.unity3d.com/2017.4/Documentation/ScriptReference/ColorUtility.TryParseHtmlString.html) static method; doesn't work.
In the code example it parses a string variable but looks like it may be wanting something like a htmlString (wut???) or isn't happy with parsing a FsmString...
-
Ah very nice!
But... you coded. :'(
Not really, calling method with parameters can hardly be called coding ;D
-
well, fancy coding or not, it requires users to understand more than just how playmaker works, which partially defeats the point of using playmaker, but also presents a potential learning opportunity.
does this work now? someone had an issue with it, but it would be cool to use if it works.
-
Hi,
ok, I made conversion actions from hex to color using the Unity 2017 ColorUtility class, the action are be flexible enough to let you add # and check if the hex if valid as well.
ConvertHexToColor
ConvertColorToHex
(https://twitter.com/JeanAtPlayMaker/status/1062967630473105408)
Bye,
Jean