Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Popup color from color string like `#f2d3aa` with Emacs

Tags:

emacs

colors

I'm using scss-mode in Emacs.

There are a lot of color string like #f2d3aa in text.

I wonder if there is a function that pop up a color square from string of current position.

Is there a emacs function like this?

like image 994
ironsand Avatar asked Sep 14 '13 21:09

ironsand


2 Answers

I'm using rainbow-mode. It's a minor mode that fontifies the text color descriptions as you type them.

Very user-friendly, since it's got only one interactive function (i.e. rainbow-mode). It's available from MELPA.

rainbow-mode example

like image 63
abo-abo Avatar answered Nov 10 '22 13:11

abo-abo


Here are a couple of tools that can help:

  • hexcolour.el -- shows such hex color codes in their own color in the text

  • palette.el -- interactive color palette: takes such hex codes as input and provides them as output (in addition to color names etc.)

  • hexrgb.el -- (used by the color palette and other libraries) color manipulation functions

The first one, hexcolour.el, is the closest to what you asked for.

like image 25
Drew Avatar answered Nov 10 '22 12:11

Drew