我如何在html中嵌入svg中使用cmyk? [英] how can i use cmyk in an svg embeded in html?

查看:845
本文介绍了我如何在html中嵌入svg中使用cmyk?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了
fill =CMYK(0.50,0.50,0.00,0.00)
填充多边形并显示为黑色。我知道黑色是后备。我正在编辑一个HTML文档中的svg

解决方案

我相信你需要扩展你的答案以指定你打算如何打印SVG。当然颜色可以通过颜色和可选的icccolor指定。在icccolor中,您可以指定#CMYK色彩空间作为备用。如下:

    

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



如果我在浏览器中查看浏览器,它根本不支持它。它甚至不使用RGB颜色,我一定要选择Red来显示它。但是,如果我使用的产品在SVG中支持icc-color(如RenderX的渲染引擎从XSL FO,HTML和SVG制作PDF),我在PDF中获得了正确的颜色。



下面的屏幕截图显示了浏览器在左边呈现的SVG代码片段以及RenderX在右边的代码片段,您可以看到,PDF中使用了CMYK颜色。




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

解决方案

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.

这篇关于我如何在html中嵌入svg中使用cmyk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆