Random color generation using PHP

前端 未结 13 1816
终归单人心
终归单人心 2020-12-14 09:48

I\'m trying to generate random HTML colors in PHP, but I\'m having trouble getting them to look similar, or in the same family. Is there some function I can use to generate

13条回答
  •  被撕碎了的回忆
    2020-12-14 10:40

    Found something much nicer posted on the blog of someone called Craig Lotter:

    $randomcolor = '#' . dechex(rand(0,10000000));
    

提交回复
热议问题