2017-06-06 5 views
0

私は現在、色を使ったプロジェクトを行っていますが、Adobe RGBカラーのリストを16進数で生成するリストや方法があるかどうか疑問に思っていましたか?Adob​​e RGBカラースペース全体のリストを16進数で表示しますか?

ありがとうございます!ここで

+0

は、これは言うのwikiの記事を読んでからわずかです値は小数として[0,0,0] ... [1,1,1]であるので、私はおそらくその点を見逃しています。あなたは000000からFFFFFFまでのテーブルを意味するだけですか? –

+0

@DaveSええ、そういうものが本当に理想的でしょう – dnkmelon

+0

数字の16,777,216行のリスト? –

答えて

0

はPythonスクリプトで、次のように実行した場合には、128メガバイトのファイルに書き込みます

python hexen.py > reallybiglist.txt 

ここでスクリプト

# write int as 6-digit hex 
def int_6_hex(intval): 
    hex = "" 
    while intval != 0: 
    hexValue = intval % 16 
    hex = toHexChar(hexValue) + hex 
    intval = intval // 16 

    while len(hex) < 6: 
    hex = "0" + hex 

    return hex 

# Convert an integer to a single hex digit in a character 
def toHexChar(hexValue): 
    if 0 <= hexValue <= 9: 
    return chr(hexValue + ord('0')) 
    else: # 10 <= hexValue <= 15 
    return chr(hexValue - 10 + ord('A')) 

#loop to ffffff 
def main(): 
    intmax = 256*256*256 
    # intmax = 256 -- to see a preview 
    loopint = 0 
    while (loopint < intmax): 
    print(int_6_hex(loopint)) 
    loopint = loopint + 1 

main() # Call the main function 
関連する問題