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 300K
  • Win 174K
  • OS X 77K
  • Linux 49K
Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23
Windows 227 426 278 302 413 429 432 504 442 306 309 399 405 456 535 451 240 319 428 460 466 444 456 287 396 482 462 491 467 360 287 317 499 457 512 463 425 307 319 454 473 423 507 410 298 361
OS X 68 129 113 77 131 141 124 143 163 109 98 117 154 156 155 161 91 97 118 159 162 146 153 101 103 142 138 152 165 118 102 111 152 154 185 171 161 107 92 141 181 182 171 133 113 104
Linux 56 120 60 74 99 103 99 81 103 87 73 124 90 106 99 98 67 87 96 108 125 103 133 85 77 120 107 103 99 85 73 71 88 90 117 94 115 70 87 109 123 116 110 106 70 83

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