We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.
Home › Forums › Programming › Changing base color using HTML color code
Tagged: color picker html puzzle
By name you mean the python name it show when you hover the cursor over the rgb node?
I marked it with green in the screenshot I posted earlier.
Chief 3D Verger | LinkedIn | Twitter
Thank you Yuri, I will check it out later.
Unfortunately it doesn’t seem to work. Here is my setup:
Hi dragosburian, You need to add the following line right after applying the new color, it should update the material to display the changes:
mat.needsUpdate = true;
Co-founder and lead developer at Soft8Soft.
Thank you guys! It work now. Cheers!
Hi Yuri,
This code alway return 0,0,0
Yuri Kovelenov wrote: hex = Math.floor(hex); var x = (hex >> 16 & 255) / 255; var y = (hex >> 8 & 255) / 255; var z = (hex & 255) / 255; color = new Vector4(x,y,z,1.0)
hex = Math.floor(hex);
var x = (hex >> 16 & 255) / 255; var y = (hex >> 8 & 255) / 255; var z = (hex & 255) / 255;
color = new Vector4(x,y,z,1.0)
this code assumes that you supply a hexadecimal number See here for converting a textual value https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
Log in / Register