Skip to content

Color Picker Should Default to the Current Code's Color Format #4978

Closed

Description

@Number-3434

Describe The Bug

The default colour picker next to Color classes will replace the current colour with Color.fromARGB regardless of whether the current colour format is Color(0xFFFFFFFF) or Color.fromRGBO.

Activity

  1. changed the title [-]Colour Picker Does Not Account For Current Colour Format[/-] [+]Color picker should default to the same color format as the current code[/+] on Feb 12, 2024
  2. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    and removed on Feb 12, 2024
  3. added this to the On Deck milestone on Feb 12, 2024
  4. DanTup commented on Feb 12, 2024

    @DanTup
    Member

    You can cycle through the different formats by clicking on the label - but I agree it would be nice if we ordered these so that the one using the same format was first in the set.

  5. Number-3434 commented on May 21, 2024

    @Number-3434
    Author

    I have also previously encountered a bug in which the conversion may change the actual colour.

    Specifically, converting rgba(r, g, b, 15) to rgbo format (which has 0-255, 0-255, 0-255, 0-1 range) ends up with rgba(r, g, b, 16) once you've cycled through all the colours.

  6. DanTup commented on May 21, 2024

    @DanTup
    Member

    @Number-3434 can you reproduce this? Could you file a new issue about that specifically?

  7. changed the title [-]Color picker should default to the same color format as the current code[/-] [+]Color Picker Should Default to the Current Code's Color Format[/+] on May 21, 2024
  8. modified the milestones: On Deck, v3.112.0 on Apr 23, 2025
  9. DanTup commented on May 27, 2025

    @DanTup
    Member

    I tried implementing this, but unfortunately it doesn't work because of how VS Code uses the index of the current format when requesting new color presentations.

    Eg. you have Color(0xff000000) and open the colour picker - we put that format first in the set. You drag around the colour picked and everything works fine.

    Next, you click to change the format - which updates the document with the new format. Now, when VS Code asks us for presentations, we return them in a different order, because the document has a different format to originally. However, VS Code knows you are on "the second format" in the current open colour picker, so it shows the second result from the results (but we have put the current format first).

    Since there is no state and we don't know the original format when you opened the colour picker, we can't make the order stable if we are adjusting it based on the current contents of the file.

    I think the only way to allow this would be with some changes to VS Code to support us providing some description of the format (for example the constructor name without the args) so that it could match them up and keep the format consistent itself.

  10. modified the milestones: v3.112.0, Backlog on May 27, 2025
  11. DanTup commented on Jul 31, 2025

    @DanTup
    Member

    I'm cleaning up the issue tracker and closing some issues that are unlikely to be fixed/implemented in the foreseeable future.

    Since we can't resolve this issue without changes to VS Code, I'm going to close it. If this changes, we can re-open it.

  12. added
    can't implementAn issue we can't resolve because it requires changes in another project that don't seem likely.
    on Jul 31, 2025
  13. removed this from the Backlog milestone on Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked on vs code / lsp / dapRequires a change in VS Code to progresscan't implementAn issue we can't resolve because it requires changes in another project that don't seem likely.in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions