Hi,
I created a simple tool to help to convert hexadecimal colors to the Babylon format, generating the code. As I use some color palletes like flatuicolors.com, it is very helpful for me.
I hope it can be helpful for you!
Thanks
Hi,
I created a simple tool to help to convert hexadecimal colors to the Babylon format, generating the code. As I use some color palletes like flatuicolors.com, it is very helpful for me.
I hope it can be helpful for you!
Thanks
Hi, nice work, but i’ll add that this is also supported directly in Babylon if you prefer hex
BABYLON.Color3.FromHexString()
in my case it didn’t work why???
did i something wrong??
let pushButtonPulser = scene.getMaterialByName('Button');
// pushButtonPulser.albedoColor = new BABYLON.Color3(211/255, 63/255, 5/255);
pushButtonPulser.albedoColor = new BABYLON.Color3.FromHexString('#D33F05FF');
you need to remove the new cause BABYLON.Color3.FromHexString is a function
Incidentally, #D33F05FF - > #D33F05
is a 6-digit number, and when copying from the inspector, etc., it gets stuck with FF, so we need to remove that.
That’s because you are entering a Color4 value as Color3. Color3 has no alpha. So the last two digits (being the alpha) are set to opaque == FF.
And then, note that I found the inspector has some glitches (i.e. for the GUI) where eventually you cannot retrieve or enter a hex(a) value despite that it is supported (with code or through the editor).