0

I'm using PHP and I would like to create an array with colour codes. My base colour's hex code is #16A7B4 (red 180, green 22, and blue 111). I want all colours to be as dark as the base color #16A7B4, but other colours must be different enough that I can see that there are several colours. In other words, it is not allowed that the colours look too similar.

In other words, colours like #164EB4 and #38B416 would be OK, because they are not too similar with #16A7B4. But colour #B41668 is too similar with the base colour.

My problem is that I have no idea how to do this. I can add the base colour to an array, but that is all I can do. I do not know how I could calcute more colour codes which are as dark as the base color but not too similar with it.

I need 100 different colour codes (RGB or hex). Any ideas?

xms
  • 429
  • 5
  • 24
  • did you google? https://stackoverflow.com/questions/9186038/php-generate-rgb https://stackoverflow.com/questions/10708965/generate-random-colors https://stackoverflow.com/questions/5614530/generating-a-random-hex-color-code-with-php , just fix with color areas you want to start with – clearshot66 Jun 27 '17 at 15:24
  • I would suggest to use RGB because then you have more simple values to work with and you can compare the RGBs much better than Hex-Codes. – Bernhard Jun 27 '17 at 15:25
  • Also?https://stackoverflow.com/questions/7263140/random-color-generation-using-php – clearshot66 Jun 27 '17 at 15:25
  • As I said, the colours should not be too similar. – xms Jun 27 '17 at 15:41
  • @clearshot66 I like [this](https://stackoverflow.com/a/9186155/5833180) but how can I make it to avoid colours which are too similar? – xms Jun 27 '17 at 16:05

0 Answers0