且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

给定一个RGB值,如何创建一个色调(或阴影)?

更新时间:2023-01-08 12:54:31


  • 对于阴影,将每个分量乘以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.