【问题标题】:How to convert a color code formatted as 0.986246,0.007121,0.027434,1.000000如何转换格式为 0.986246,0.007121,0.027434,1.000000 的颜色代码
【发布时间】:2021-10-07 15:23:14
【问题描述】:

我需要将一堆颜色代码转换为十六进制。代码格式如下:

0.986246,0.007121,0.027434,1.000000

有没有人见过这种格式并知道转换为十六进制的方法?

【问题讨论】:

  • 您期望的结果是什么?我怀疑您只需要将 [0, 1] 映射到 [0x0, 0xff] 但如果没有看到完整的示例就很难回答。

标签: colors


【解决方案1】:

手动

CMYK 编码: https://convertingcolors.com/cmy-color-0.9862_0.0071_0.0274.html?search=CMY(0.986246,0.007121,0.027434)

这是一个解码器,最后一个 1.0 是 alpha 或透明度

脚本

如果您精通 Javascript,可以使用脚本进行转换:What is the formula to convert a color in CMYK to hex?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-14
    • 2012-07-07
    • 2012-06-03
    • 1970-01-01
    • 2014-05-20
    • 2010-09-19
    • 2023-04-06
    • 2011-04-17
    相关资源
    最近更新 更多