【发布时间】:2014-01-13 05:55:35
【问题描述】:
如何在 PHP 中将颜色“蓝色”或“绿色”或其他颜色转换为 rgb 或 hex?
hexdec 或 dechex 帮不了我。
【问题讨论】:
-
你不能神奇地转换它;查看this table 进行转换。
-
或查看this answer
-
谢谢,我找到了摆脱你提出的方法的方法。
如何在 PHP 中将颜色“蓝色”或“绿色”或其他颜色转换为 rgb 或 hex?
hexdec 或 dechex 帮不了我。
【问题讨论】:
嗯...我认为您应该创建颜色数组
$colors = array('red' => '2550000', 'blue' => '000255000');
hexdec 在另一个系统中解码您的数字,而不是颜色名称。
【讨论】: