ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Color​Picker

by Weslly H. ALL Needs Review Top 25

A multi-platform color picker plugin

Labels css

Details

Installs

  • Total 1.31M
  • Win 939K
  • Mac 202K
  • Linux 173K
May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22
Windows 4 256 252 254 205 194 279 313 245 351 312 209 220 258 283 302 343 362 220 224 236 271 275 303 304 208 257 266 288 323 413 302 191 226 250 241 288 255 266 231 253 279 297 345 312 332
Mac 0 23 24 26 16 16 15 16 21 32 17 14 18 25 25 28 16 35 19 12 20 27 27 35 22 14 16 23 23 25 39 16 16 17 18 28 21 20 25 11 21 25 23 28 35 23
Linux 0 29 23 30 16 26 37 34 29 18 33 28 20 24 25 39 27 31 25 25 25 34 41 32 28 27 27 27 25 18 31 26 36 27 39 28 28 31 19 27 39 25 34 37 25 31

Readme

Source
raw.​githubusercontent.​com

Mac OSX

Linux

Windows

Installation

Install this repository via Package Control.

Usage

To insert or change a selected color, use:

  • Linux: ctrl+shift+c
  • Windows: ctrl+shift+c
  • OS X: cmd+shift+c

or use menu action

  • Tools** -> **ColorPicker

By default, the hex color code is inserted using uppercase letters. To use lowercase letters instead, copy the contents of **Preferences -> Package Settings -> ColorPicker -> Settings-Default** to the empty file created by selecting **Preferences -> Package Settings -> ColorPicker -> Settings-User**, then change "color_upper_case" to false.

Calling from Other Plugins

To commands are provided to assist in calling a color picker from other plugins. Info is shared between the plugins via a settings file. It does not have to exist on disk; it can exist only in memory for the sole purpose of sharing the return. It is advised to use a unique name for the settings file. The data is returned in the settings key color_pick_return. It is advised to set color_pick_return to None in your settings file before calling any of the commands. So you can tell if it set teh variable or not.

ColorPickApiIsAvailableCommand

This command is used to test if ColorPicker is installed.

>> settings = sublime.load_settings('my_shared.sublime-settings')
>> settings.set('color_pick_return', None)
>> sublime.run_command('color_pick_api_is_available', {'settings': 'my_shared.sublime-settings'})
>> print(settings.get('color_pick_return'))
True

ColorPickApiGetColorCommand

This command is used to call a color picker and get the selected value. It takes a setings file and an optional default_color.

>> settings = sublime.load_settings('my_shared.sublime-settings')
>> settings.set('color_pick_return', None)
>> sublime.run_command('color_pick_api_get_color', {'settings': 'my_shared.sublime-settings', 'default_color': '#ff0000'})
>> print(settings.get('color_pick_return'))
#23af44

Acknowledgements