darken(base00, pct) returns base00, so telescope's panes never get a ground of their own

Open Beginner friendly
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
lua
Domain
devtools

Research direction

Inspect base16-colorscheme.lua around line 533 and the Telescope highlight definitions. Run the stock default-dark or default-light reproduction in Neovim, then verify that TelescopeNormal, TelescopeBorder, and TelescopeResultsTitle have a distinct background while the other darken callers retain their behavior.

Written by the indexing model from the issue text.

Description

The telescope branch means to put the picker on a background one shade off the rest:

local darkerbg = darken(M.colors.base00, 0.1)   -- base16-colorscheme.lua:533

but darken blends its argument towards base00 rather than darkening it, so this particular call is an identity — r + (r - r) * pct == r — for every scheme and every pct. TelescopeNormal, TelescopeBorder and TelescopeResultsTitle land on the ordinary background, while TelescopePromptNormal and TelescopeSelection, which come from base02, do move.

Repro, stock scheme, no telescope needed:

require("base16-colorscheme").setup("default-dark")
for _, g in ipairs({ "Normal", "TelescopeNormal", "TelescopePromptNormal" }) do
  print(g, ("#%06X"):format(vim.api.nvim_get_hl(0, { name = g }).bg))
end
-- Normal                #181818
-- TelescopeNormal       #181818   <- expected a shade under Normal
-- TelescopePromptNormal #343434

default-light behaves the same way: Normal and TelescopeNormal are both #F8F8F8.

It shows up as more than a missing shade in a terminal with background opacity, since a cell whose background equals the default background is drawn translucent — the results pane comes out transparent under an opaque prompt.

The other seven callers rely on blending towards base00 (darken(base0B, 0.85) is how DiffAdd's background is arrived at), so the fix belongs at the call site rather than in the function. PR follows.

Dominant language
Lua
Stars
655
Forks
94
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.