#!/bin/ksh -p
# Background colour fader
# One arg: white to black
# Two args: white to colour to black
# Three+ args: fade through all colours on line

if (( $# == 0 )) ; then
  echo "Usage: `basename $0` angle [colours...]"
  exit 1
fi

angle=${1}

if (( $# == 1 )) ; then
  set -A w "white" "black"
elif (( $# == 2 )) ; then
  set -A w "white" "$2" "black"
else
  shift
  set -A w $@
fi

bggen ${w[*]} -r "$angle" | xv -root -quit -
