Talk:Color presets
From Avisynth wiki
(Difference between revisions)
(Raffriff42 please read) |
(Raffriff42 please read) |
||
Line 5: | Line 5: | ||
I suggest you use those. Example (color_blueviolet): | I suggest you use those. Example (color_blueviolet): | ||
− | R = 138 | + | R = 138 <br> |
− | G = 043 | + | G = 043 <br> |
− | B = 226 | + | B = 226 <br> |
− | M = max(R,G,B) = 226 | + | M = max(R,G,B) = 226 <br> |
− | m = min(R,G,B) = 43 | + | m = min(R,G,B) = 43 <br> |
− | C = M - m = 183 | + | C = M - m = 183 <br> |
− | B = M => H = 60*(4+(R-G)/C) = 60*(4+(138-43)/183) = 271.15 | + | B = M => H = 60*(4+(R-G)/C) = 60*(4+(138-43)/183) = 271.15 <br> |
− | L = (M+m)/2 = 134.5 | + | L = (M+m)/2 = 134.5 <br> |
− | S = C/(255-|2*L-255|) = 183/(255-|2*134.5-255|) = 0.76 | + | S = C/(255-|2*L-255|) = 183/(255-|2*134.5-255|) = 0.76 <br> |
Also you should add an appropriate reference for this. [[User:Admin|Admin]] 00:18, 19 August 2014 (CEST) | Also you should add an appropriate reference for this. [[User:Admin|Admin]] 00:18, 19 August 2014 (CEST) |
Revision as of 23:19, 18 August 2014
@Raffriff42,
I don't know what formula's you used to calculated the HSL values but they seem to be wrong. Wikipedia contains the formula's where 0<=H<360.0, 0<=S<=1 and 0<=L<=255. I suggest you use those. Example (color_blueviolet):
R = 138
G = 043
B = 226
M = max(R,G,B) = 226
m = min(R,G,B) = 43
C = M - m = 183
B = M => H = 60*(4+(R-G)/C) = 60*(4+(138-43)/183) = 271.15
L = (M+m)/2 = 134.5
S = C/(255-|2*L-255|) = 183/(255-|2*134.5-255|) = 0.76
Also you should add an appropriate reference for this. Admin 00:18, 19 August 2014 (CEST)