Use CMYK on web page

后端 未结 4 944
耶瑟儿~
耶瑟儿~ 2021-02-08 03:50

I need to use CMYK colors on my web page. Is there any way to use CMYK in CSS or may be convert CMYK to RGB using JavaScript?

EDIT:
I mean I have co

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-08 04:28

    In the CSS Color Module Level 4 of the W3C as of 5 November 2019, there is a function called device-cmyk that can be used to define a device dependent CMYK color value.

    Example:

    color: device-cmyk(0 81% 81% 30%);
    

    The function returns an RGB value that the device calculates by trying to convert the CMYK color to an RGB value that matches the CMYK color as close as possible.

    Note: I can't find anything regarding the browser support. I guess that no browser is currently supporting this.

提交回复
热议问题