\name{BlueRed}
\alias{BlueRed}
\title{
  Generate Colour Scale For Plotting
}
\description{
  Returns a colour scale corresponding to specified data values or a specified 
  number of colours.
}
\usage{
  BlueRed(data, scale = c("equal", "linear", "split"), white = median(data), 
  yellow = 0, cyan = 0, invert = FALSE, format = c("hex", "rgb"))
}
\arguments{
  \item{data}{
    A vector of distinct data values corresponding to the colours or the number 
    of colors (>= 1) to be created.
  }
  \item{scale}{
    Controls the colour gradients (see Details). Must be either '"equal"' 
    (the default), '"linear"' or '"split"' (or any unique partial match).
  }
  \item{white}{
    The data value corresponding to the colour white.
  }
  \item{yellow}{
    A number between 0 and 1 indicating the amount of yellow to insert between 
    white and red. If 0 (the default) then no yellow is used. Larger values 
    indicate more yellow.
  }
  \item{cyan}{
    A number between 0 and 1 indicating the amount of cyan to insert between 
    white and blue. If 0 (the default) then no cyan is used. 
    Larger values indicate more cyan. Not implemented.
  }
  \item{invert}{
    Logical: if 'TRUE', negative data values are red and positive values are 
    blue; if 'FALSE' (the default) then vice-versa.
  }
  \item{format}{
    The format in which the colours are returned (see Value). Must be either 
    '"hex"' (the default) or '"rgb"' (or any unique partial match).
  }
}
\details{
  One colour is created for each value in 'data'. Colours range from blue for 
  data values less than 'white' to red for data values greater than 'white'. 
  If 'scale' equals '"linear"' then colour intensity scales linearly with 
  absolute data value: highest intensity corresponding to the maximum absolute 
  value of 'data'.
  If 'scale' equals '"split"' then linear intensity scales are constructed 
  separately for blue and red colours so that the maximum intensity is attained 
  by both blue and red. If 'scale' equals '"equal"' then intensities are 
  equally spaced regardless of the data values.
}
\value{
  If 'format' is '"hex"' then returns a character vector of hexadecimal RGB 
  numbers. If 'format' is '"rgb"' then returns a matrix with three columns 
  containing RGB intensities.
}
\author{
  History:
  1.0  -  2005-05  (C. Ferro,                             -  Original code
       -              \email{c.a.t.ferro@reading.ac.uk})  -
}
\keyword{datagen}
