给定一个RGB值,如何创建一个色调(或阴影)? [英] Given an RGB value, how do I create a tint (or shade)?
本文介绍了给定一个RGB值,如何创建一个色调(或阴影)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给定一个RGB值,如 168,0,255
,如何创建色彩(使其更亮)和阴影(使其更暗) / p>
Given an RGB value, like 168, 0, 255
, how do I create tints (make it lighter) and shades (make it darker) of the color?
推荐答案
-
对于阴影,将每个分量乘以1/4,1/2,3
For shades, multiply each component by 1/4, 1/2, 3/4, etc. of its previous value, depending on how dark the color should be.
对于色调,计算(255 - 上一个值) ),将它乘以1/4,
1/2,3/4等,并将其与上一个值相加。For tints, calculate (255 - previous value), multiply that by 1/4, 1/2, 3/4, etc. and add that to the previous value.
这篇关于给定一个RGB值,如何创建一个色调(或阴影)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文