预期字符串,得到了空值。

我有以下代码,应该只打印一个数字,但实际上输出了上述错误:

print(
  math.abs(
    tonumber(TColor, 16) -
    tonumber(FColor, 16)
  ) / 100 * (math.abs(minV - maxV) / 100 * curV) + tonumber(FColor, 16)
)

即使是 tostring(math......) 也没法解决它。

点赞
用户1190388
用户1190388

错误是因为TcolorFcolor中有一个是nil。错误是由tonumber()抛出的。

你可以在这里看到它被复制。

2013-09-16 21:33:47