scottmckendry / cyberdream.nvim

🤖💤 High-contrast, Futuristic & Vibrant Coloursheme for Neovim
MIT License
490 stars 26 forks source link

Recipes for transparent theme switching 👨🏻‍🍳 #78

Open AlejandroSuero opened 3 weeks ago

AlejandroSuero commented 3 weeks ago

Description

When using :CyberdreamToggleMode or theme.variant = "light" the text color makes it unreadable.

I will propose to use the dark variant of colours for at least the text if transparent is true.

Neovim version?

v0.10.0

What should happen?

I can read the text without problem.

What happened instead?

The text color makes it hard to read

Screenshot 2024-06-16 at 23 40 41 Screenshot 2024-06-16 at 23 45 25

Your configuration

{
    "scottmckendry/cyberdream.nvim",
    lazy = false,
    priority = 1000,
    config = function()
        require("cyberdream").setup({
            transparent = true,
            italic_comments = false,
            hide_fillchars = false,
            borderless_telescope = { border = false, style = "nvchad" },
            terminal_colors = true,
            theme = {
                variant = "light",
            },
        })
        vim.cmd("colorscheme cyberdream")
    end,
}
scottmckendry commented 3 weeks ago

This is expected behaviour. If you enable transparency, neovim is no longer responsible for rendering the background. This is handled by the terminal emulator.

I'd planned for this when I added the toggle option by triggering the CyberdreamToggleMode event. This allows users to execute custom code to update their terminal emulator settings if that's something that they support.

My long-term plan is to add some more recipes to the readme with some simple lua examples on how to achieve this with popular terminal emulators.

AlejandroSuero commented 3 weeks ago

@scottmckendry okay, didn't know that was the expected behaviour. I don't personally use light themes so I thought it was unexpected.

scottmckendry commented 3 weeks ago

No worries @AlejandroSuero! I'll keep this open for now as a reminder to document this at some point.

The light theme can look quite nice with the transparent theme, so long and the terminal colors are also updated to something suitable. That's why I've added both dark and light variants of each extra to ensure this can be achieved with minimal effort.