Skip to content

Commit d376e10

Browse files
authored
Color: added support for add color values using uppercase (#21687)
* Color: added support for add color values using uppercase * Update Color.html * Update Color.html * Update Color.html * Update Color.html * Update Color.html
1 parent ae1098e commit d376e10

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/api/en/math/Color.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ <h3>[method:Color setStyle]( [param:String style] ) </h3>
310310
Translucent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted,
311311
but the alpha-channel coordinate will be discarded.<br /><br />
312312

313-
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
313+
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange'.
314314
</p>
315315

316316
<h3>[method:Color setColorName]( [param:String style] ) </h3>

docs/api/zh/math/Color.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ <h3>[method:Color setStyle]( [param:String style] ) </h3>
303303
半透明颜色例如 "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" 也能支持,
304304
但是alpha通道的值将会被丢弃。<br /><br />
305305

306-
注意,对于X11颜色名称,多个单词(如暗橙色)变成字符串“darkorange”(全部是小写字母)
306+
注意,对于X11颜色名称,多个单词(如暗橙色)变成字符串“darkorange”。
307307
</p>
308308

309309
<h3>[method:Color setColorName]( [param:String style] ) </h3>

src/math/Color.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Color {
264264
setColorName( style ) {
265265

266266
// color keywords
267-
const hex = _colorKeywords[ style ];
267+
const hex = _colorKeywords[ style.toLowerCase() ];
268268

269269
if ( hex !== undefined ) {
270270

0 commit comments

Comments
 (0)