Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Util.is_dark resolves incorrectly. #315

Closed
4 tasks done
mehalter opened this issue Sep 15, 2024 · 0 comments · Fixed by #316
Closed
4 tasks done

bug: Util.is_dark resolves incorrectly. #315

mehalter opened this issue Sep 15, 2024 · 0 comments · Fixed by #316
Labels
bug Something isn't working

Comments

@mehalter
Copy link
Contributor

Did you check docs and existing issues?

  • I have read all the todo-comments.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of todo-comments.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.10.1

Operating system/version

Arch Linux

Describe the bug

Util.is_dark is not resolving correctly in some edge cases it looks like which results in some colorschemes having unreadable todo notes.

#00B298 is an example of a color that results in true in is_dark and gets a light foreground which is unreadable

image

Steps To Reproduce

  1. Set DiagnosticHint fg to #00B298
  2. Make a NOTE highlight
  3. See that the text is unreadable

Expected Behavior

The text should get the dark foreground color which makes it readable

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    {
      "folke/todo-comments.nvim",
      dependencies = { { "nvim-lua/plenary.nvim", lazy = true } },
      opts = {},
    },
    {
      "folke/tokyonight.nvim",
      opts = {
        on_highlights = function(hl)
          hl.DiagnosticHint = { fg = "#00B298" }
        end,
      },
    },
  },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant