【发布时间】:2012-05-06 02:42:17
【问题描述】:
好的,所以我创建了一个配色方案,以突出显示输入数据(文本)的某些部分。
但是我需要制作一个 Legend 来告诉用户每种颜色的含义。这是我到目前为止所拥有的: ` /输入/
<div style="text-color: hsl($col,35%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,45%, 50%);">/*input*/</div>
<div style="text-color: hsl($col,50%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,55%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,60%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,70%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,80%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,90%, 100%);">/*input*/</div>
<div style="text-color: hsl($col,100%, 100%);">/*input*/</div>
` 其中 input- 将是颜色的标签,例如这意味着强大的结果。 $col 是一个变量,每次都会改变颜色,例如0 = 红色等。
我需要知道如何将我在这里的颜色变成一个图例,它位于一个 html 页面上。
有什么帮助吗?
谢谢:)
【问题讨论】:
-
我已经阅读了三遍,但没有理解您的问题。您是在问如何替换字符串中的变量或如何获取颜色值?请更具体。另请注意,IE