Template talk:ColorMath

From Second Life Wiki
Jump to navigation Jump to search

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:

<{{#pad:0.941|5|0|right}}, {{#pad:0.945|5|0|right}}, {{#pad:0.949|5|0|right}}>

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:

<{{#pad:Expression error: Unexpected < operator.|5|0|right}}, {{#pad:Expression error: Unexpected < operator.|5|0|right}}, {{#pad:Expression error: Unexpected < operator.|5|0|right}}>

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)