Generate high contrast random color using PHP
问题 I need to generate random colors for all the users in the system. The trick is that 2 users cant have very similar colors, they need to be distinguishable. I have the code to generate random colors given the original mix color but cant find a way to generate random colors with high contrast using only PHP public static function generateRandomColor($rgb) { $red = rand(1, 256); $green = rand(1, 256); $blue = rand(1, 256); if (! empty($rgb)) { $red = ($red + $rgb['red']) / 2; $green = ($green +