-------------------------------------------
switch variable: $colscale -- funct color scale
-------------------------------------------
switch value: 4 => two-cond red-grn (complex data)

The "bi" (bicolor) color scale designed for
two-condition, phase-analyzed data (standard
ON/OFF design).

The first half of the phases (correlated with the
ON stim in an ON/OFF design) are, by default,
colored red.  The the second half (correlated
with the OFF stim) are colored green.

A *positive* angle_offset cancels a delay in the
functional signal.

The phase value limits applied when truncphase is
selected are in units of 0-1, *after* the phase
has been (optionally) adjusted by:

  "rev" tickbox:
     -> reverse time with $revphaseflag

  "invph" tickbox:
     -> add half a cycle with $invphaseflag (=mult by -1)

  "angleoffset" entry:
     -> subtract $angle_offset

Adjustable/Arbitrary ON and OFF colors

Arbitrary ON and OFF colors can be entered in the
[fn-]F3 panel in the three r,g,b "col1" and the
three r,g,b "col2" entries (a little below the
REDRAW button).

The first time the "bi" color scale is selected,
these r,g,b entries will be set to pure red (255
0 0) and pure green (0 255 0), but can be reset
arbitrarily (update on REDRAW or carriage return
in an entry).

Implementation

The phaseangle is first converted from 0-1 to
0-2Pi.  This is then turned into a color
saturation as follows:

 sat = tanh(phaseangle*(fslope -   0)) *
        -tanh(phaseangle*(fslope -  Pi)) *
        -tanh(phaseangle*(fslope - 2Pi));

The result is an adjustable, clipped sine-like
curve.  At fslope=1.0, the color saturation of
each phase is approximately the sine of the phase
angle.  Phases near the boundary between red and
green will fade to gray, and full saturation will
only be reached at a phase of Pi/2 and 3Pi/2.
With fslope > 10, all the colors in each half of
the phase wheel will be fully saturated, and the
red/green transition will be abrupt.
