光学三元色:红(R),绿(G),蓝(B)
颜色三要素:色相(H),饱和度(S),明度(V)
调色网址:https://www.fontke.com/tool/rgb/01407a/
RGB值由R,G,B三个值组成,每个值的取值范围为0到255,因此RGB能表示的颜色总共有256 ^ 3(= 16777216)个。
由RGB中的最大值来表示明度,公式:V = max(R, G, B) / 255。
由RGB中的最小值来表示饱和度,公式:S = 1 - min(R, G, B) / max(R, G, B)。
由RGB中最大的两个值来表示色相,公式:
R = max(R, G, B)时,H = 60 × (G - B) / (R - min(G, B))
G = max(R, G, B)时,H = 60 × (B - R) / (G - min(B, R)) + 120
B = max(R, G, B)时,H = 60 × (R - G) / (B - min(B, R)) + 240
明度(V),可以理解为颜色的照明度,在黑夜中,手持着手电筒。当手电筒没电时表示明度为0%,看到的所有物体颜色都是黑色。当手电筒电力充足时表示明度为100%,看到的颜色都是物体原本的颜色。
#000000(0%,0%,100%,0% )黑色
#00001A(0%,0%,100%,10%)
#000033(0%,0%,100%,20%)
#00004D(0%,0%,100%,30%)
#000066(0%,0%,100%,40%)
#000080(0%,0%,100%,50%)
#000099(0%,0%,100%,60%)
#0000B3(0%,0%,100%,70%)
#0000CC(0%,0%,100%,80%)
#0000E6(0%,0%,100%,90%)
#0000FF(0%,0%,100%,100%)蓝色
饱和度(S) ,
RGB中的最大值与最小值相同时,饱和度为0。
#000000(0%, 0%)黑色
#1A1A1A(10%, 0%)
#333333(20%, 0%)
#4D4D4D(30%, 0%)
#666666(40%, 0%)
#808080(50%, 0%)灰色
#999999(60%, 0%)
#B3B3B3(70%, 0%)
#CCCCCC(80%, 0%)
#E6E6E6(90%, 0%)
#FFFFFF(100%, 0%)白色
#FFFFFF(0%,0%,100%,0% )白色
#E6E6FF(0%,0%,100%,10%)
#CCCCFF(0%,0%,100%,20%)
#B3B3FF(0%,0%,100%,30%)
#9999FF(0%,0%,100%,40%)
#8080FF(0%,0%,100%,50%)
#6666FF(0%,0%,100%,60%)
#4D4DFF(0%,0%,100%,70%)
#3333FF(0%,0%,100%,80%)
#1A1AFF(0%,0%,100%,90%)
#0000FF(0%,0%,100%,100%)蓝色
色相(H)
色相是由其中两种元色混合而成
#FF0000(100%,0%, 0%, 0 )红色
#FF5500(75%,25%, 0%, 20 )
#FFAA00(60%,40%, 0%, 40 )
#FFFF00(50%,50%, 0%, 60 )黄色
#AAFF00(40%,60%, 0%, 80 )
#55FF00(25%,75%, 0%, 100)
#00FF00(0%,100%, 0%, 120)绿色
#00FF55(0%, 75%, 25%,140)
#00FFAA(0%, 60%, 40%,160)
#00FFFF(0%, 50%, 50%,180)青色
#00AAFF(0%, 40%, 60%,200)
#0055FF(0%, 25%, 75%,220)
#0000FF(0%, 0%,100%,240)蓝色
#5500FF(25%, 0%, 75%,260)
#AA00FF(40%, 0%, 60%,280)
#FF00FF(50%, 0%, 50%,300)品红
#FF00AA(60%, 0%, 40%,320)
#FF0055(75%, 0%, 25%,340)
#FF0000(100%,0%, 0%, 0 )红色
参考资料:https://blog.csdn.net/hanshanbuleng/article/details/80383813
http://www.360doc.com/content/18/0511/15/46318754_753115911.shtml