Generate Random Color distinguishable to Humans

前端 未结 9 914
旧时难觅i
旧时难觅i 2020-12-12 14:11

I am trying to randomly generate a color in hex in javascript.

However the colors generated are almost indistinguishable from eachother.
Is there a way to improv

9条回答
  •  春和景丽
    2020-12-12 14:49

    I agree with all the answers, we don't really know what you expect here...

    This is a possibility that can give you the choice between the rgb(r, g, b) output for css elements, and the hex output...

    This is a quick example, you have just to adapt this draft but it works as it on Firefox :

    
    

    Then you can retrieve the value as here bellow :

    
    

    I hope this can help you. Best regards.

提交回复
热议问题