I am using php's dechex function to generate random colors as per requirements.Here is my working code.
dechex(rand(0x000000, 0xFFFFFF));
Howerver, I want to use dark colors only. I have found this code so far which generated only light colors thanks for this and this article.
However, I am yet to find a proper solution to generate only dark colors. I have tried several things like below.
'#' . substr(str_shuffle('AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00112233445566778899'), 0, 6);
And
'#' . substr(str_shuffle('ABCDEF0123456789'), 0, 6);
But these, sometimes generating light colors randomly.
Edit:
I would like to have a solution with hex and rgb.
How Can I achieve this ?