-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Labels
Milestone
Description
Refs: #178242
- anyOS @joaomoreno
- anyOS @hediet
Complexity: 2
The PR introduces the standalone color picker - a color picker that can be spawned for all document types to insert colors. It also introduces a default DocumentColorProvider, which is used when there is no valid DocumentColorProvider provided by extensions. This default provider generates colors using the CSS format. It can be used to show default inline color decorators.
To test the standalone color picker:
- Choose a file where there is an associated DocumentColorProvider provided by an extension - this could be a CSS file. Add text representing colors into the file.
- Place the cursor in the editor and spawn the standalone color picker with
Show or Focus Standalone Color Picker. - Choose a color and verify that you can insert a color of your choice using either the
Insertbutton or theEnterkey, when the color picker is focused. - Place the cursor on text that has been identified as a color. Typically this text would have a colored inline box decoration in front of it. To see these decorations, you may have to enable
Editor: Color Decorators- this setting is turned on by default. - Spawn the color picker on the text, and verify that the whole text is selected. Verify that the color picker's previous
Insertbutton, readsReplace. Check that you are able to replace the color as expected. Verify that the color presentations available (hex/rgba/ rgb for example) are the same as the color presentations in the hover widget appearing on hovering on the associated inline color decorator.
Repeat the steps above for a file with no associated DocumentColorProvider. This could be for example a TypeScript file. Note that since there is no extension color provider, the color picker will insert CSS formatted colors.
To test the default inline decorators:
- There is a setting called
Editor: Default Color Decoratorswhich controls the appearance of default inline color decorators based on the previously introduced default DocumentColorProvider. Use this setting, with the settingEditor: Color Decoratorsto verify the following 4 cases. Have two files open, one with colors that should be detected with an extension color provider and one with colors that should be detected with the default color provider.
Editor: Color Decorators ON |
Editor: Color Decorators OFF |
|
|---|---|---|
Editor: Default Color Decorators ON |
inline color decorators visible in both files | inline color decorators not visible in either file |
Editor: Default Color Decorators OFF |
inline color decorators visible in file of type covered by the existing color provider, but not the other | inline color decorators not visible in either file |
Reactions are currently unavailable