开发者

Code to generate hexadecimal values of all colors

开发者 https://www.devze.com 2023-04-03 18:21 出处:网络
Hi guys I need to generate a list of all possible 16 million colors in the 6 digit hexadecimal notation - how can that be done, I would appreciate a formula for that. I\'m building the scrip开发者_Sta

Hi guys I need to generate a list of all possible 16 million colors in the 6 digit hexadecimal notation - how can that be done, I would appreciate a formula for that. I'm building the scrip开发者_StackOverflow社区t in php here.


Just print all values from 0 to 2^24 and format it as hex with 6 digits...

long max = pow(2,24);
for(long i = 0; i < max; i++)
{
printf("%6x\n", i);
}

Something like that?


for i = 0 to 16 million
    print i as hexa
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号