Skip to content

Commit c96c1f0

Browse files
committed
fix(lib/Color): Color.lumanance -> Color.luminance
Correct misspelling of "luminance". Rename function `Color:lumanance()` of the `Color` library to `Color:luminance()`.
1 parent 6829ce3 commit c96c1f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/github-theme/lib/color.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ function Color:to_css(with_alpha)
236236
return string.format('#%0' .. l .. 'x', n)
237237
end
238238

239-
---Calculate the relative lumanance of the color
239+
---Calculate the relative luminance of the color
240240
---https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
241241
---@return number
242-
function Color:lumanance()
242+
function Color:luminance()
243243
local r, g, b = self.red, self.green, self.blue
244244
r = (r > 0.04045) and ((r + 0.055) / 1.055) ^ 2.4 or (r / 12.92)
245245
g = (g > 0.04045) and ((g + 0.055) / 1.055) ^ 2.4 or (g / 12.92)
@@ -346,8 +346,8 @@ Color.BG = Color.init(0, 0, 0, 1)
346346
---Returns the contrast ratio of the other against another
347347
---@param other Color
348348
function Color:contrast(other)
349-
local l1 = self:lumanance()
350-
local l2 = other:lumanance()
349+
local l1 = self:luminance()
350+
local l2 = other:luminance()
351351
if l2 > l1 then
352352
l1, l2 = l2, l1
353353
end

0 commit comments

Comments
 (0)