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

Color​Picker

by Weslly H. ST2/ST3 Top 25

A multi-platform color picker plugin

Labels css

Details

Installs

  • Total 252K
  • Win 144K
  • OS X 66K
  • Linux 41K
Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16
Windows 0 462 467 465 302 390 445 465 528 500 478 298 340 446 466 442 454 461 298 310 428 442 441 446 422 298 296 359 437 434 425 420 269 284 376 435 445 413 370 254 243 346 388 352 345 361
OS X 0 178 186 154 91 110 157 148 171 184 155 125 113 137 173 189 167 162 107 109 157 154 159 168 147 114 97 157 128 153 129 143 122 127 146 135 150 194 145 129 126 141 129 139 132 134
Linux 0 118 122 111 83 86 130 125 106 111 138 90 103 84 121 99 113 103 85 91 104 84 105 108 100 92 92 86 100 98 112 114 98 96 91 112 109 131 107 94 76 91 106 101 99 106

Readme

Source
raw.​githubusercontent.​com

Mac OSX

Mac OSX

Linux

Linux

Windows

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

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