Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Numeric colour tip
- X-seq: zsh-workers 24997
 
- From: Peter Stephenson <pws@xxxxxxx>
 
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
 
- Subject: Numeric colour tip
 
- Date: Mon, 12 May 2008 12:50:44 +0100
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
 
Those of you experimenting with colours on terminals that allow more
than the simple set of colours might like to be reminded about
user-defined arithmetic functions.  For example, I've got the following
to set up colours for rxvt.
    autoload -U zmathfuncdef
    # colour takes red, green, blue (0..3) as arguments
    zmathfuncdef colour '16 + $1 * 16 + $2 * 4 + $3'
    zle_highlight=(
      # sort of lightish blue on dark red
      region:fg=$((colour(2,2,3))),bg=$((colour(1,0,0)))
      # yellow on dark blue
      isearch:fg=$((colour(3,3,0)))bg=$((colour(0,0,1)))
      # white on not very dark green
      default:fg=$((colour(3,3,3))),bg=$((colour(0,1,1)))
    )
-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author