Template talk:ColorMath
Hex numbers must not include the hash prefix!
As of April 2022, I noticed that the page has lots of 'garbage' instead of properly-done ColorMath. I first thought that prefixing the hex value with #
(since the template page says that the hash symbol is 'optional') might fix it, but no — it makes everything even worse, since the ColorMath template breaks when it finds that #
prefix!
I'd guess this should be tested. Here are my own experiments:
Example 1:
{{ColorMath|hex=f0f1f2}} {{#var:vector}}
Result:
<0.941, 0.945, 0.949>
Should show:
<{{#pad:0.941|5|0|right}}, {{#pad:0.945|5|0|right}}, {{#pad:0.949|5|0|right}}>
Example 2:
{{ColorMath|hex=#f0f1f2}} {{#var:vector}}
Result:
<Expression error: Unexpected < operator., Expression error: Unexpected < operator., Expression error: Unexpected < operator.>
Expected (when fixed):
<{{#pad:0.941|5|0|right}}, {{#pad:0.945|5|0|right}}, {{#pad:0.949|5|0|right}}>
... but instead throws three Expression error: Unexpected < operator.
errors, as of April 2022.
— Gwyneth Llewelyn (talk) 10:57, 6 April 2022 (PDT)