Random color generation using PHP

前端 未结 13 1791
终归单人心
终归单人心 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:38

    A few years ago I came across this class. It lets you generate complimentary colors based on a seed value.

    If you're looking for something more general, limit yourself to a general range using rand (obviously below 255) and the use base_convert.

提交回复
热议问题