Skip to content

Commit

Permalink
fix(palette): get canvas from primitives
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tmillr committed Sep 21, 2023
1 parent bf4cd7e commit 0a2ee28
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 63 deletions.
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_dark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_dark_colorblind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_dark_dimmed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_dark_high_contrast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_dark_tritanopia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_light_colorblind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_light_high_contrast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/palette/github_light_tritanopia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 0a2ee28

Please sign in to comment.