How do I write a RGB color value in JavaScript?

前端 未结 6 1566
不知归路
不知归路 2020-12-28 13:09

I am trying to change the color of the function swapFE() below and I can\'t figure out how to write it. I was told to change the color of the phrase node to the color value

6条回答
  •  感动是毒
    2020-12-28 13:45

    this is better function

    function RGB2HTML(red, green, blue)
    {
        var decColor =0x1000000+ blue + 0x100 * green + 0x10000 *red ;
        return '#'+decColor.toString(16).substr(1);
    }
    

提交回复
热议问题