Jade Dragon Theme
Tangerine Theme
Amber CRTs, Tangerine Dream, retro-futuristic, kandy kolored tangerine flake streamline baby… all these things held some influence over the creation of this theme. Well, those things, and the fact I like orange.
Obligatory screenshots
Tangerine shell
Tangerine Perl
HexRGB.el With Some Extras
If you use a lot of CSS we have a number of useful CSS DSLs, like SASS and LESS both of which give us a collection of color manipulation functions.
Adding a few of these helpful color functions to Emacs is relatively simple and the bulk of the work required is already done by Drew Adams in his hexrgb.el extension.
I’ve added a few small modifications in
this version, the
function: hexrgb-hsv-to-hex
accepts an additional argument
nb-digits
so that hex colors returned are with 2 digits per r,g,b
value.
(hexrgb-hsv-to-hex 0.05 0.7 0.4 2)
;;------------------ ^ ---- ^ --- ^ ----- ^ -------
;; hue sat light nb-digits
Which returns #6639B8
Previously, hexrgb.el returned hex colors with 4 digits per channel (r, g, b), I’m not sure why, but obviously for a large number of people, this isn’t all that useful.
I’ve also added a few convenience functions that provide color manipulation direct from hex colors. Currently these just work in eshell or ielm (interactive emacs lisp modes.)
For example:
(hexrgb-hex-set-brightness "#ff0000" 0.3)
returns #4C0000
(hexrgb-hex-set-saturation "#ff0000" 0.5)
returns #FF7F7F
(hexrgb-hex-set-hue "#FF0000" 0.6)
returns #0066FF
These functions aren’t complicated, they use the hex-to-hsv existing
function, grab the h, s or v values and then convert back to a hex
color value. This makes working with colors easier, for example, you
could add (require 'hexrgb)
to a theme definition and use the
functions to manipulate theme colors, or just switch on
rainbow-mode when
you’re in eshell, and play.
Here’s the function definitions:
(defun hexrgb-hex-set-brightness
(hex brightness)
"set brightness of a hex color, amount values from 0-1
returns a 6 digit hex color"
(let* ((hsv (hexrgb-hex-to-hsv hex))
(h (first hsv)) (s (second hsv)) (v (third hsv)))
(hexrgb-hsv-to-hex h s (* v brightness) 2)))
(defun hexrgb-hex-set-saturation
(hex saturation)
"set saturation of a hex color, amount values from 0-1
returns a 6 digit hex color"
(let* ((hsv (hexrgb-hex-to-hsv hex))
(h (first hsv)) (s (second hsv)) (v (third hsv)))
(hexrgb-hsv-to-hex h (* s saturation) v 2)))
(defun hexrgb-hex-set-hue
(hex hue)
"set hue of a hex color, amount values from 0-1
returns a 6 digit hex color"
(let* ((hsv (hexrgb-hex-to-hsv hex))
(s (second hsv)) (v (third hsv)))
(hexrgb-hsv-to-hex hue s v 2)))
Two New Emacs24 Themes
Jump directly to the new themes…
I have a number of Emacs color themes that were built a few years ago, they use the old color-theme.el
system, I’d also adapted a web-based theme creator, so that it could load existing themes, as long as they were in a fixed format, the same as used by http://themes.sweyla.com/
Anyway, I’ve begun to convert some of my regular themes over to the new deftheme
format. The main advangatge is there’s no reliance on color-theme
anymore. The only drawback for me is that I will need to update my existing theme-editor.
But in the meantime, it’s possible to create deftheme
style themes with customize-create-theme
but it’s not the best way to to it, frankly, even if I converted my existing theme tool, it would still be very limited.
The best thing to do is learn how to work with theme source code, which like everything that extends Emacs, is written in emacs lisp.
The basic template for making a theme is as follows:
;;; Filename: name-theme.el
(deftheme name
"DOCSTRING")
;; Not a bad idea to define a palette...
(let (
(color-1 "#ffffff")
(color-2 "#ff0000")
(color-3 "#00ff00")
(color-4 "#0000ff"))
;; Set faces
(custom-theme-set-faces
'name ;; you must use the same theme name here...
'(default ((t (:foreground ,color-1 :background black))))
'(cursor ((t (:background ,color-4))))
'(fringe ((t (:background ,color-3))))
;;; etc...
;;; don't use these settings of course,
;;; they're horrible.
)
;; Set variables
(custom-theme-set-variables
'name ;; again specify the same theme name...
'(any-variable EXPR)
(provide-theme 'name)
;;; name-theme.el ends here
For a more advanced example to work from, look at the new built in themes, I’d recommend tango-theme.el
which you’ll be able to find using, M-x describe-theme
and then type tango
.
The help buffer will give you a link to the source code, and you can study it further, (if you have questions, I’m very happy to answer them in the comments.)
Two new themes…
DeepBlueDay and MechanicalTurq
Download…
Save them to your emacs custom theme folder, ~/.emacs.d/
by default, and in Emacs use M-x enable-theme
to load and enable them (TAB completion will be available there, to make your life easier.)
If you have questions, let me know.
Powerline.el Enhanced
Powerline is an awesome little enhancement for Emacs, by an original author unknown, you can find the original version at http://emacswiki.org/emacs/powerline.el
I’ve added a few different xpm shapes as alternatives to the arrows or flatshapes, a rounded or folded corner, and a set of diagonals.
Grab the updated powerline from here: https://gist.github.com/2945235
Put it somewhere in your Emacs load path (e.g. ~/.emacs.d
) and add
the following lines to the end of your .emacs
/ init.el
- to load
it, set the colors and graphic shape:
(require 'powerline)
;; colors...
(setq powerline-color1 "#222") ;; dark grey;
(setq powerline-color2 "#444") ;; slightly lighter grey
;; shape...
(setq powerline-arrow-shape 'arrow) ;; mirrored arrows,
;; see below for the shape options
Shapes
(setq powerline-arrow-shape 'arrow) ;; 18px high arrows
(setq powerline-arrow-shape 'arrow14) ;; 14px high arrows
(setq powerline-arrow-shape 'half) ;; flat
(setq powerline-arrow-shape 'percent) ;; ...? (I have no idea)
(setq powerline-arrow-shape 'curve) ;; scallop curve
New shapes in this version
(setq powerline-arrow-shape 'rounded) ;; new, round corner
(setq powerline-arrow-shape 'chamfer) ;; new, folded corner
(setq powerline-arrow-shape 'slant-left) ;; new, diagonal from left
(setq powerline-arrow-shape 'slant-right) ;; new, diagonal from right
(setq powerline-arrow-shape 'slant) ;; mirrored diagonals
Emacs 24.1.5 OSX Fullscreen Binaries
For convenience, I’ve built a couple of OS X binaries of Emacs24.1.5,
First, built with Lion OS X 10.7.4 and patched to use Lion’s new fullscreen mode, I have tested it only on 10.7.4 (in fact I’m writing this post with it.) but, personally I prefer the old ns-toggle-fullscreen style of Fullscreen, as I use multiple monitors. However, it’s useful if you have one screen and prefer the Mission control screen swiping style. Non Mac users, suspend your teeth nashing.
The binary can be downloaded from here:
(You’ll need 7z/tar to uncompress it, The Unarchiver will do the trick.)
I’ve also built a 10.6.8 (and up) compatible build of Emacs24.1.5 with the older ns-toggle-fullscreen patch, which does non-exclusive fullscreen, TBH, I’d recommend you get this one unless you’re really wanting the little Lion OS X fullscreen window widget.
It’s quite possible to get the same mission control style operation, but you’ll need to drag it to it’s own space… yeah, I know, the things I make you do.
The link for this binary is:
Ok, so that’s the first post here. Enjoy.
Coming soon, powerline.el
with some new styling addons.