getColourScale function can be used to obtain a standard or customised colour scale for use in the package's image visualisation functions. A graded palette of colours between two or more key colours can be obtained using interpolatePalette.getColourScale(n)interpolatePalette(colours, n, ...)
getColourScale, a number, colour name or list (see Details). For interpolatePalette, a single integer specifying the length of the interpolated palette.colours.colorRamp.getColourScale, a list with elementsThe interpolatePalette function returns a character-mode vector representing the colours in the interpolated scale.
colours); in this case the background will be black. This is useful for binary images. Thirdly and most flexibly, a list with two named elements can be given: colours, a vector of colours representing the colour scale, perhaps created using rgb; and background, a single colour representing the background.J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18.
colours, rgb, colorRampgetColourScale(1)
interpolatePalette(c("red","yellow"), 10)Run the code above in your browser using DataLab