Difference between revisions of "Template talk:ColorMath"
(→Hex numbers must not include the hash prefix!: new section) |
(→More testing, 18 months later (or so): new section) |
||
Line 40: | Line 40: | ||
---- | ---- | ||
— [[User:Gwyneth Llewelyn|Gwyneth Llewelyn]] ([[User talk:Gwyneth Llewelyn|talk]]) 10:57, 6 April 2022 (PDT) | — [[User:Gwyneth Llewelyn|Gwyneth Llewelyn]] ([[User talk:Gwyneth Llewelyn|talk]]) 10:57, 6 April 2022 (PDT) | ||
== More testing, 18 months later (or so) == | |||
Testing: | |||
<pre><nowiki> | |||
{{ColorMath|hex=f1f1f1}} | |||
{{#var:vector}} | |||
</nowiki></pre> | |||
Result: | |||
{{ColorMath|hex=f1f1f1}} | |||
{{#var:vector}} | |||
Hmm. Not quite there yet; I still get {{code|<{{#padright:0.945|5|0}}, 0.945, 0.945>}} as a reply. {{code|#padright}} seems to be broken? | |||
— [[User:Gwyneth Llewelyn|Gwyneth Llewelyn]] ([[User talk:Gwyneth Llewelyn|talk]]) 10:15, 14 October 2023 (PDT) |
Revision as of 09:15, 14 October 2023
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)
More testing, 18 months later (or so)
Testing:
{{ColorMath|hex=f1f1f1}} {{#var:vector}}
Result:
<0.945, 0.945, 0.945>
Hmm. Not quite there yet; I still get <{{#padright:0.945|5|0}}, 0.945, 0.945>
as a reply. #padright
seems to be broken?
— Gwyneth Llewelyn (talk) 10:15, 14 October 2023 (PDT)