Color Manager Help

Controls

Buttons

  1. toggle edit-options
  2. load palette (you can also type in chars to filter the palettes)
  3. toggle view mode (in the compact-view the color fields have hover-tooltips that will show you the name and the color value)
  4. filter colors (searches in all inputs ... names and values)
  5. add new color to the palette (will be inserted at the current selection, or at the beginning if no color is selected)
  6. open palette manager (add, delete and rename palettes)
  7. edit palette in texteditor (see "edit palette in texteditor")
  8. restore palette (will restore the last save-state of the palette)
  9. save current palette

Context Menu

Right click on a color field to open the context menu ...

Select multiple colors

Hold down Shift- or Ctrl-Key to select multiple colors.

Edit colors

Each row has two inputs. The first input is for the name, the 2nd one for the color value. You can input hex colors with 3, 4, 6 or 8 digits, rgb or rgba colors, hsl or hsla colors and css gradients.

Color Picker

Edit a color value in your document

Place the cursor on a color value in your document (doesnt have to be selected). Run the command "edit in color manager" or choose it from vscode's context menu.
Use the color picker controls to change the color and use the "insert"-button on the bottom to replace the document color.

Insert a palette-color into the document

Place the cursor on a color value in your active document or at a free position. Open Color Manager and left-click on a color field in the color palette. The extension will detect if the cursor in your document is placed within a color value. In this case the color value in your document will be replaced. If the cursor is not placed on a color value, the color will be inserted at the current position. Selections will always be replaced.

⚠️ Attention! As long as the color picker is opened, inserting is disabled!

insert from list-view: insert from compact-view:

Sort colors

Info! For extensive reordering in large palettes, you should use the texteditor (see help "Edit palette in texteditor")

The extension has a sort-mode that allows you to move a single color up and down via drag and drop.

Manual sorting with Alt-Key

Holding down the Alt-Key will automatically activate the sort-mode.

⚠️ Attention! You have to change some vscode settings to use this feature properly, otherwise vscode's menubar will capture the focus when you press the Alt-Key.

Alternatively you can use the AltGr-Key, if you dont want to change the settings. AltGr will not capture the focus!

Open your vscode settings and insert the following lines:

"window.titleBarStyle": "custom",
"window.customMenuBarAltFocus": false,
"window.enableMenuBarMnemonics": false,


Manual sorting with context menu

You can permanently activate the sort-mode by opening the context menu and select "Activate Sort-Mode".



Automatic sorting:

Select at least two colors by holding down Shift or Ctrl. Then open the context menu and select "Special Functions" and "Sort by ..." There are 4 options available: by name, by value, by hue and reverse.

Convert colors

Convert color value

The color-inputs and the color picker have a small arrow-button that will convert the current color in the following order:
HEX6a > HEX3a (if possible) > RGBa > HSLa > HEX6a

Convert multiple colors

Select some colors by holding down Shift or Ctrl. Then open the context menu and select "Convert".

Why does hex- to hsl- and back to hex-conversion results in a different hex value? 😦

This does not have to be but can be, depending on the specific color value. This has something to do with the different sizes of the color systems. That behavior is the same in professional graphic- and image-editing apps and that the deviations are very small.

Add multiple colors to a palette

Select some text in your document and run the command "find colors in selection" or choose it from vscode's context menu.

The Extension will search for all color values and css gradients within the selection (or multiple selections) and adds the found values to the active palette. The values will be inserted at the position of the actively selected color (or at the beginnig if no color is selected).

Before the found colors are added to the palette, you have to confirm a dialog that shows the number of the found colors (duplicate values will be added only once)

Edit palette in texteditor

Open the edit mode and click on the button with the pencil-icon (7).

This will open the current selected palette in a new file-tab. Edit or Re-order the colors as you wish and then just save the file. The extension will automatically refresh the view as you save the file (this only works, if the palette-file is opened from the extension).

Intellisense | Add color-palettes to vscode's autocomplete feature

Add palette to autocomplete:

Run the command "intellisense add palette" and choose a palette from the dropdown. This will add the selected palette to vscode's intellisense- or automplete-feature.

⚠️ Attention! This will only work if you have specified some languages in your vscode settings. Heres an example-configuration:

"color-manager.languages": [ "css", "html", "javascript", "json", "scss" ],

If you do changes to the currently active palette, the intellisense entries will be automatically refreshed when you save the palette.

Change the autocomplete palette:

If you want to load another palette to intellisense, then run the command "intellisense add palette" again. The old palette will be removed (only one palette can be added to intellisense).

Remove a palette from autocomplete:

Run the command "intellisense remove palette".

Autostart / Make intellisense palette persistent

By default the autocomplete-palette will be removed from intellisense when you close vscode. If you want vscode to automatically load the last palette to intellisense when vscode is restarted, then put the following line into your settings:

"color-manager.autoStartIntellisense": true,

Edit and insert a Hex-Color with the prefix "0x" instead of "#"

⚠️ Attention! Hex-Colors within the Webview-Extension are still handeled with the prefix "#", but you can edit "0x"-values in your document, and you can insert "#"-values as "0x"-values to your document (this also affects the Autocomplete-feature)

Open your vscode settings and insert the following line:

"color-manager.insertClassicHex": true,

If you want to toggle that setting on the fly, then I recommend the extension "Settings Cycler".

Editing gradients

Gradients can only be edited by typing into the input for the color value. Maybe I'll include a basic gradient generator in a future release.

Customize the width of the user-interface

This functionality is useful, if you want to make a palette always appear in the same order, like in the screenshot below.

If you want to change the width of the user interface, there are two bars on the left and the right side. Hold down the mouse and drag the bar to the desired position. (Of cause vscode's sidebar has to be larger than the extension)

If you want to disable this behaviour and always use the full width, then put the following line into your settings:

"color-manager.fullWidth": true,

Customize the colors of the user-interface

By default the extension adapts to your vscode theme. I recognized that in some themes it just doesnt look good, so since v0.5.0 you can completely customize the colors of the extension.



Here is an example that you can paste into your vscode settings ... doesnt look good, but should give you a good overview!

Info! You dont have to use all of the properties! If you just want to change the appearence of the buttons, then just set the "button..."-properties

To refresh changes, toggle the visibility of the extension or run command "reload webviews" from the command palette.

"color-manager.styles": {
	"selectionBorder": "blue",
"background": "LightGrey",
"foreground": "green", // labels and lines
"popupBorder": "Fuchsia", // border for colorpicker, palette-manager and dialogbox
"inputForeground": "#000", // input-text
"inputBackground": "white", // dropdown input on top and inputs in Palette Manager
"inputBorder": "tomato",
"buttonBackground": "DarkGray",
"buttonForeground": "tomato", // button-icons and button-text
"buttonBorder": "tomato",
"buttonHoverBackground": "hsla(0, 61%, 50%, 0.51)",
"dropdownForeground": "tomato",
"dropdownBackground": "white",
"dropdownHoverBackground": "hsla(0, 61%, 50%, 0.51)",
"overlayBackground": "hsla(0, 61%, 50%, 0.51)" // overlay for dialogbox
},

Restore factory palettes | Get new palettes

Use the command "restore factory palettes" to restore the factory palettes and get new palettes that were included with an update.

⚠️ Attention! If you have customized existing factory palettes you should rename them before running the command, otherwise they will be overwritten.

Syncing color palettes with a different computer

If you are using an extension like "Settings Sync" the palettes should be synced automatically!

If you dont use a sync extension, look into the global user directory. The palettes are stored in scss-files. Just copy the scss-files to the user folder on your other computer.

Windows:
%APPDATA%\Code\User\globalStorage\royaction.color-manager
Linux:
$HOME/.config/Code/User/globalStorage/royaction.color-manager
Mac OS:
$HOME/Library/Application Support/Code/User/globalStorage/royaction.color-manager
Portable:
*your portable path*\user-data\User\globalStorage\royaction.color-manager

Don't pollute my context-menu!!! 😡

If you dont like the menu entries in vscode's context menu, put the following lines into your settings:

"color-manager.contextMenu":{
	"edit": true,
"findColors": false,
"openPicker": false,
"openPalette": false
},

Palette-Limit | Performance

The palettes are limited to 5000 entries by default, otherwise the compact view mode will get sluggish (see description below). You can override the limit with the following setting:

"color-manager.paletteLimit": 7000,
Description:

If you are in the list-view and your palette has more then 200 colors, than there will be a dynamic scroll function, which hides colors that are not visible and compensates the space with padding.

If you are in the compact-view (the view-mode with the small color fields) then there will be no performance-helper, because a window with a 700 x 900px can already contain around 1000 color fields. So a dynamic scroll function wouldn't make much sense and performance can be a bit sluggish with large palettes.

Shortcuts within the webview extension

  1. "ctrl + shift + s" will save the current palette
  2. "ctrl + s" will save the active document in vscode (this is a custom implementation ... it usually doesnt work within webview extensions)
  3. "ctrl + w" will close the webview extension (vscode"s standard shortcut for closing file tabs)


I would have implemented more shortcuts but some of them will overlap with vscode's existing shortcuts (like ctrl + e).