python - How to find the relationship, or ratio, between these hex colors? -
i'm looking implement similar http://colorschemedesigner.com/ in program i'm writing, , i've taken 3 sample colors, , colors tool found fits within scheme, , reverse-engineer pattern here, try , figure out how create own tool, since doesn't provide api, far can tell.
i've pulled 3 colors here, 1 degree of hue apart each other, colors follows, master color being color entered tool.
color rbg hls mstr hex: ff0000 255 0 0 (0.0, 0.5, 1.0) frst hex: bf3030 191 48 48 (0.0, 0.46862745098039216, 0.5983263598326359) scnd hex: a60000 166 0 0 (0.0, 0.3254901960784314, 1.0) thrd hex: ff4040 255 64 64 (0.0, 0.6254901960784314, 1.0) frth hex: ff7373 255 115 115 (0.0, 0.7254901960784313, 1.0) color rbg hls hex: ff0700 255 7 0 (0.004575163398692812, 0.5, 1.0) hex: bf3330 191 51 48 (0.003496503496503489, 0.46862745098039216, 0.5983263598326359) hex: a60400 166 4 0 (0.004016064257028125, 0.3254901960784314, 1.0) hex: ff4540 255 69 64 (0.004363001745200675, 0.6254901960784314, 1.0) hex: ff7673 255 118 115 (0.0035714285714285956, 0.7254901960784313, 1.0) color rbg hls hex: ff0d00 255 13 0 (0.008496732026143797, 0.5, 1.0) hex: bf3730 191 55 48 (0.00815850815850816, 0.46862745098039216, 0.5983263598326359) hex: a60800 166 8 0 (0.008032128514056233, 0.3254901960784314, 1.0) hex: ff4940 255 73 64 (0.007853403141361256, 0.6254901960784314, 1.0) hex: ff7a73 255 122 115 (0.008333333333333378, 0.7254901960784313, 1.0)
added 180 degrees of hue: #00cc00
color rbg hls hex: 00cc00 0 204 0 (0.3333333333333333, 0.4, 1.0) hex: 269926 38 153 38 (0.3333333333333333, 0.37450980392156863, 0.6020942408376962) hex: 008500 0 133 0 (0.3333333333333333, 0.2607843137254902, 1.0) hex: 39e639 57 230 57 (0.3333333333333333, 0.5627450980392157, 0.7757847533632286) hex: 67e667 103 230 103 (0.3333333333333333, 0.6529411764705882, 0.7175141242937852)
i've done few basic substractions see if find relationship hand, example, master , 2nd color 65% different, 59% different, 0% different, based of second colors r, g, or b's value divided master's same value.
my question is: there python package me out this? failing there ratio missing?
edit: got curious , started looking through js source code try , figure out how it, i'm not anywhere near close understanding it. i've uploaded here: http://tankorsmash.com/transfers/csd3.js since it's on pastebin limit.
have @ hsl , hsv color models: http://en.wikipedia.org/wiki/hsl_and_hsv
there library support in pil
Comments
Post a Comment