Модуль:Toolbox: различия между версиями

initial commit
 
во дурак
Строка 1: Строка 1:
local p = {}
local p = {}


function textcolor(frame)
function p.textcolor(frame)
     local color = frame.args[1]
     local color = frame.args[1]
     local r = tonumber(string.sub(color, 1, 2), 16)
     local r = tonumber(string.sub(color, 1, 2), 16)
Строка 11: Строка 11:
     0.587 * (g * g) +
     0.587 * (g * g) +
     0.114 * (b * b)
     0.114 * (b * b)
    )^(1/2)
  )^(1/2)
     if hsp > 127.5 then
     if hsp > 127.5 then
         out = "1F1F1B"
         out = "1F1F1B"