How do I determine darker or lighter color variant of a given color?

前端 未结 13 681
情话喂你
情话喂你 2020-12-04 07:37

Given a source color of any hue by the system or user, I\'d like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effe

13条回答
  •  我在风中等你
    2020-12-04 08:20

    Any variations in color are better done in HSL/HSV.

    A good test is to interpolate between two equivalent values in RGB space and HSL space. The ramp in HSL space looks like a natural progression. In RGB space it typically looks quite unnatural. HSL maps to our visual color space perception much better than RGB.

提交回复
热议问题