Alternative way to "pick" a color

Alex Kost 5ca1383ca9 gitignore: Add "tmp" and "autoloads.el" 8 anni fa
.gitignore 5ca1383ca9 gitignore: Add "tmp" and "autoloads.el" 8 anni fa
README.md 18dcf10370 New melpa URL 9 anni fa
make-color-test.el 2e7f3fa880 Replace "macol" with "make-color" everywhere 10 anni fa
make-color.el a1b34e95cc Fix hard-coding of "n" key binding in a message 10 anni fa

README.md

About

Make-color provides a convenient (IMHO) way for finding a suitable color by updating a color of some text with keyboard.

Basically, you press r/g/b/... keys and see how a probing region of text changes its foreground/background color (red/green/blue/... components).

Installation

Manual

  • Put make-color.el into any directory from load-path or if you prefer to keep it in a separate directory:
  (add-to-list 'load-path "/path/to/make-color-dir")
  • Add autoloads for the main functions:
  (autoload 'make-color "make-color" nil t)
  (autoload 'make-color-switch-to-buffer "make-color" nil t)

MELPA

The package can be installed from MELPA (with M-x package-install or M-x list-packages).

Usage

Shortly: M-x make-color and press r/R/g/G/... keys (see below).

More detailed description:

  1. (Optional) Select any region (it will be used as a sample, so you may want to select a colorful text, for example a piece of elisp code).
  2. M-x make-color or M-x make-color-switch-to-buffer to make a buffer in make-color-mode.
  3. (Optional if step 1 was omitted) Select a text a color of which you want to change and press n (stands for "new probing region").
  4. Press keys to change a color of the probing region (see below).

MakeColor buffer is not read-only, so you can "cut and paste" (I mean "kill and yank") text there as usual, as well as undo the changes.

Key bindings

Key bindings in make-color-mode (can be explored with C-h m):

  • r/R, g/G, b/B – decrease/increase red, green, blue components (RGB model)
  • c/C, m/M, y/Y – decrease/increase cyan, magenta, yellow components (RGB model)
  • h/H, s/S, l/L – decrease/increase hue, saturation, luminance (HSL model)
  • RET – change current color (prompt for a value)
  • n – set new probing region
  • SPC – highlight current probing region; with arg switch to the specified region
  • N – switch to the next probing region
  • P – switch to the previous probing region
  • p – change a step of components shifting
  • f/d, t – switch between changing foreground/background color
  • k – put current color into kill-ring
  • F/D – put foreground/background color at point into kill-ring
  • u – undo