本文介绍了CMYK值作为背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须使用RGB值设置div的backgroundColor.我能够做到这一点.
I have to set backgroundColor of div using RGB values . Im able to get this way.
<div style="width: 100px; height: 100px; background-color: rgb(255,0,0)">
</div>
现在,由于我也有CMYK(0,1,0.5,0)值,所以您能协助我如何使用这些值实现相同的功能.
Now, Since I also have CMYK (0,1,0.5,0) values , So Can you assist me how to achieve same with these values.
我这样做,但没有收获.
Im doing this way , but no gain .
<div style="width: 100px; height: 100px; background-color: device-cmyk(0, 1, 0.5, 0)">
</div>
谢谢
推荐答案
您不能直接在CSS中执行此操作.您必须将CMYK值转换为其他位置的RGB对应值(可能通过服务器端脚本),并在CSS中使用转换后的值.请注意,转换实际上与SVG函数没有什么不同.
You can't do it directly in CSS. You'll have to convert your CMYK values to their RGB counterparts somewhere else (probably by a server-side script) and use the converted values in your CSS. Note that converting is not actually much different to what the SVG function does.
这篇关于CMYK值作为背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!