Content deleted Content added
RichardW57 (talk | contribs) Recorded more copying. |
Olivier Ph. (talk | contribs) No edit summary |
||
Line 41:
::: You could also write <code>p._lum = color2lum</code> instead of the second function definition, but setting it out explicitly, as you have done, helps whoever is importing the module to see what parameters to supply. Cheers --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 15:41, 6 January 2019 (UTC)
::::Sure, looks good. I'll update the sandbox version. --[[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 15:43, 6 January 2019 (UTC)
== Possible typo in code? ==
Observing the code, I might have spotted a typo lines 160 and 161.
I think <syntaxhighlight lang='lua'>if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then</syntaxhighlight>should read <syntaxhighlight lang='lua'>if mw.ustring.match(c3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then</syntaxhighlight> instead.
Here <code>v3</code> is expected to be a number, thus there is no point in applying it a regular expression. Besides, given the four lines, above, it seems logical to use <code>c3</code> variable here instead of <code>v3</code>.
My apologies if I would have misinterpreted your code.
Kindly, [[User:Olivier Ph.|Olivier Ph.]] ([[User talk:Olivier Ph.|talk]]) 12:11, 13 October 2020 (UTC)
|