From 0a2ee289b56e5301ab0dd24187e09b1aa27de5ed Mon Sep 17 00:00:00 2001 From: Tyler Miller Date: Wed, 20 Sep 2023 19:15:07 -0700 Subject: [PATCH] fix(palette): get `canvas` from primitives This should also correct any issues with the `Normal` bg being off or incorrect, as this color (i.e. the `Normal` bg, the global bg) ultimately derives from `canvas.default` (found in the palette). Fixes #298 --- lua/github-theme/palette/github_dark.lua | 9 ++------- lua/github-theme/palette/github_dark_colorblind.lua | 9 ++------- lua/github-theme/palette/github_dark_dimmed.lua | 9 ++------- lua/github-theme/palette/github_dark_high_contrast.lua | 9 ++------- lua/github-theme/palette/github_dark_tritanopia.lua | 9 ++------- lua/github-theme/palette/github_light.lua | 9 ++------- lua/github-theme/palette/github_light_colorblind.lua | 9 ++------- lua/github-theme/palette/github_light_high_contrast.lua | 9 ++------- lua/github-theme/palette/github_light_tritanopia.lua | 9 ++------- 9 files changed, 18 insertions(+), 63 deletions(-) diff --git a/lua/github-theme/palette/github_dark.lua b/lua/github-theme/palette/github_dark.lua index 7bf31b76..a38084dd 100755 --- a/lua/github-theme/palette/github_dark.lua +++ b/lua/github-theme/palette/github_dark.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.gray[7]) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -42,12 +42,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.gray[7], - overlay = scale.gray[9], - inset = scale.gray[8], - subtle = scale.gray[9], - }, + canvas = primitives.canvas, border = { default = scale.gray[9], diff --git a/lua/github-theme/palette/github_dark_colorblind.lua b/lua/github-theme/palette/github_dark_colorblind.lua index cc78cfea..670caf43 100644 --- a/lua/github-theme/palette/github_dark_colorblind.lua +++ b/lua/github-theme/palette/github_dark_colorblind.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.gray[10]) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -42,12 +42,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.gray[10], - overlay = scale.gray[9], - inset = scale.black, - subtle = scale.gray[9], - }, + canvas = primitives.canvas, border = { default = scale.gray[7], diff --git a/lua/github-theme/palette/github_dark_dimmed.lua b/lua/github-theme/palette/github_dark_dimmed.lua index 69ecdcb1..07b24a62 100644 --- a/lua/github-theme/palette/github_dark_dimmed.lua +++ b/lua/github-theme/palette/github_dark_dimmed.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.gray[10]) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -42,12 +42,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.gray[10], - overlay = scale.gray[9], - inset = scale.black, - subtle = scale.gray[9], - }, + canvas = primitives.canvas, border = { default = scale.gray[7], diff --git a/lua/github-theme/palette/github_dark_high_contrast.lua b/lua/github-theme/palette/github_dark_high_contrast.lua index 66c037c9..1f59fffb 100644 --- a/lua/github-theme/palette/github_dark_high_contrast.lua +++ b/lua/github-theme/palette/github_dark_high_contrast.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.gray[10]) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -42,12 +42,7 @@ local palette = { on_emphasis = scale.gray[10], }, - canvas = { - default = scale.gray[10], - overlay = scale.gray[9], - inset = scale.black, - subtle = scale.gray[9], - }, + canvas = primitives.canvas, border = { default = scale.gray[4], diff --git a/lua/github-theme/palette/github_dark_tritanopia.lua b/lua/github-theme/palette/github_dark_tritanopia.lua index 0b9e4966..0dc502e1 100644 --- a/lua/github-theme/palette/github_dark_tritanopia.lua +++ b/lua/github-theme/palette/github_dark_tritanopia.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.gray[10]) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -42,12 +42,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.gray[10], - overlay = scale.gray[9], - inset = scale.black, - subtle = scale.gray[9], - }, + canvas = primitives.canvas, border = { default = scale.gray[7], diff --git a/lua/github-theme/palette/github_light.lua b/lua/github-theme/palette/github_light.lua index 4de3f80c..70332246 100644 --- a/lua/github-theme/palette/github_light.lua +++ b/lua/github-theme/palette/github_light.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.white) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -43,12 +43,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.white, - overlay = scale.white, - inset = scale.gray[1], - subtle = scale.gray[1], - }, + canvas = primitives.canvas, border = { default = scale.gray[3], diff --git a/lua/github-theme/palette/github_light_colorblind.lua b/lua/github-theme/palette/github_light_colorblind.lua index f88e7d0e..04017f38 100644 --- a/lua/github-theme/palette/github_light_colorblind.lua +++ b/lua/github-theme/palette/github_light_colorblind.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.white) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -43,12 +43,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.white, - overlay = scale.white, - inset = scale.gray[1], - subtle = scale.gray[1], - }, + canvas = primitives.canvas, border = { default = scale.gray[3], diff --git a/lua/github-theme/palette/github_light_high_contrast.lua b/lua/github-theme/palette/github_light_high_contrast.lua index 04769424..dc59b0e0 100644 --- a/lua/github-theme/palette/github_light_high_contrast.lua +++ b/lua/github-theme/palette/github_light_high_contrast.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.white) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -43,12 +43,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.white, - overlay = scale.white, - inset = scale.white, - subtle = scale.gray[2], - }, + canvas = primitives.canvas, border = { default = scale.gray[9], diff --git a/lua/github-theme/palette/github_light_tritanopia.lua b/lua/github-theme/palette/github_light_tritanopia.lua index 7a174dc3..4bfda0e4 100644 --- a/lua/github-theme/palette/github_light_tritanopia.lua +++ b/lua/github-theme/palette/github_light_tritanopia.lua @@ -13,7 +13,7 @@ local scale = primitives.scale C.WHITE = C(scale.white) C.BLACK = C(scale.black) -C.BG = C(scale.white) +C.BG = assert(primitives.canvas.default) local function alpha(color, a) return color:alpha_blend(a):to_css() @@ -43,12 +43,7 @@ local palette = { on_emphasis = scale.white, }, - canvas = { - default = scale.white, - overlay = scale.white, - inset = scale.gray[1], - subtle = scale.gray[1], - }, + canvas = primitives.canvas, border = { default = scale.gray[3],