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.

Changing base color using HTML color code

Home Forums Programming Changing base color using HTML color code

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #7877
    dragosburian
    Customer

    By name you mean the python name it show when you hover the cursor over the rgb node?

    #7879

    I marked it with green in the screenshot I posted earlier.

    Chief 3D Verger | LinkedIn | Twitter

    #7880
    dragosburian
    Customer

    Thank you Yuri, I will check it out later.

    #7884
    dragosburian
    Customer

    Unfortunately it doesn’t seem to work. Here is my setup:

    #7890

    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.

    #7892
    dragosburian
    Customer

    Thank you guys! It work now. Cheers!

    #20301
    lamthanhle
    Customer

    Hi Yuri,

    This code alway return 0,0,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)

    :wacko: :wacko: :wacko:

    #20310

    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

    Chief 3D Verger | LinkedIn | Twitter

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.