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

Cannot Visualize Colors #203

Closed
AminBhst opened this issue Jan 27, 2023 · 7 comments · Fixed by #205
Closed

Cannot Visualize Colors #203

AminBhst opened this issue Jan 27, 2023 · 7 comments · Fixed by #205

Comments

@AminBhst
Copy link

I have flutter-tools setup but the color visualizer does not work. It only shows the color white no matter what the selected color is.
Here is my config below :

 require("flutter-tools").setup {
    debugger = {
      enabled = true,
      run_via_dap = true,
    },
    outline = { auto_open = false },
    decorations = {
      statusline = { device = true, app_version = true },
    },
    widget_guides = { enabled = true, debug = true },
    dev_log = { enabled = false, open_cmd = "tabedit" },
    lsp = {
      color = {
        enabled = true,
        background = true,
        virtual_text = true,
        virtual_text_str = "",
      },
      settings = {
        showTodos = true,
        renameFilesWithClasses = "prompt",
      },
      on_attach = require("ryewell.lsp.handlers").on_attach,
      capabilities = require("ryewell.lsp.handlers").capabilities,
    },
  }
@Chaitanyabsprip
Copy link

I am facing the same issue

@sidlatau
Copy link
Collaborator

sidlatau commented Feb 1, 2023

It works for me:
image
My setup:

    color = { 
      enabled = true,
      background = false, 
      foreground = false, 
      virtual_text = true, 
      virtual_text_str = "", 
    },

It works in both 3.3.10 and 3.7.0 Flutter versions.
What flutter versions you are using? What Neovim version?

@Chaitanyabsprip
Copy link

nvim version : NVIM v0.9.0-dev-763+ge86d2734a
flutter version: 3.3.10

        color = {
          enabled = true,
          background = false,
          foreground = false,
          virtual_text = true,
          virtual_text_str = '',
        },

image

@sidlatau
Copy link
Collaborator

sidlatau commented Feb 2, 2023

Maybe transparent background is used?
I see it is not supported yet:
image

There is a config.background_color property that could be set then.

https://github.com/akinsho/flutter-tools.nvim/blob/main/lua/flutter-tools/lsp/color/utils.lua#L203-L205

@Chaitanyabsprip
Copy link

oh alright, what is the format of the configuration property? I tried rrggbb with and without the # char and it is not working

@Chaitanyabsprip
Copy link

I followed the code to understand it, made it work.

        color = {
          enabled = true,
          background = false,
          background_color = { r = 19, g = 17, b = 24},
          foreground = false,
          virtual_text = true,
          virtual_text_str = '',
        },

The color I mentioned is basically the stock bg color of the color scheme I am using

@sidlatau
Copy link
Collaborator

sidlatau commented Feb 2, 2023

Great! I created PR to update README with this missing background color config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants