问题
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 document
回答1:
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.
回答2:
CSS doesn't support CMYK but it's proposed:
http://dev.w3.org/csswg/css-color/#cmyk-colors
回答3:
CMYK is for print, you should be working with RGB for web.
来源:https://stackoverflow.com/questions/27968635/how-can-i-use-cmyk-in-an-svg-embeded-in-html