how can i use cmyk in an svg embeded in html?

前端 未结 2 601
有刺的猬
有刺的猬 2021-01-16 16:08

I\'ve tried fill=\"CMYK(0.50, 0.50, 0.00, 0.00)\" For the fill of a polygon and it shows as black. I know that black is the fallback. I am editing an svg inside of an HTML

相关标签:
2条回答
  • 2021-01-16 17:08

    CSS doesn't support CMYK but it's proposed:

    http://dev.w3.org/csswg/css-color/#cmyk-colors

    0 讨论(0)
  • 2021-01-16 17:12

    I believe you need to expand on your answer to specify how you intend to print the SVG. Certainly colors can be specified through "color" and optionally "icccolor". IN "icccolor" you can specify #CMYK color space as an alternate. As in:

     <rect x="25" y="250" width="250" height="310" fill="rgb(255,0,0) icc-color(#CMYK, 26%, 99%, 99%, 24%)"/>
    

    http://www.w3.org/TR/2011/REC-SVG11-20110816/painting.html#SpecifyingPaint

    IF I render this in the browser to look at the browser does not support it at all. It does not even use the RGB color, I made sure to pick Red to show this. If however I use a product that does support icc-color in SVG (like RenderX's rendering engine to make PDF from XSL FO, HTML and SVG) I do get the correct color in the PDF.

    The below screen shot shows that SVG snippet rendered on the left by the browser and on the right by RenderX and as you can see, the CMYK color is used in the PDF.

    CMYK in PDF

    0 讨论(0)
提交回复
热议问题