Skip to content

Commit

Permalink
fix #49
Browse files Browse the repository at this point in the history
  • Loading branch information
zztrieuzz committed Jun 19, 2022
1 parent a86f9b8 commit 9c50f2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/windline/cterm_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ local function color_distance(r1, g1, b1, r2, g2, b2)
end

local function rgb2cterm(hex_color)
if type(hex_color) == "number" then
return
end
local r = tonumber(hex_color:sub(2, 3), 16)
local g = tonumber(hex_color:sub(4, 5), 16)
local b = tonumber(hex_color:sub(6, 7), 16)
Expand All @@ -36,6 +39,7 @@ local function rgb2cterm(hex_color)
local dist2 = color_distance(r, g, b, r2, g2, b2)
return dist1 < dist2 and idx1 or idx2
end
return{

return {
rgb2cterm = rgb2cterm
}

0 comments on commit 9c50f2c

Please sign in to comment.