Unit ColorSchemes

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

ColorSchemes provides method for converting from a fraction in the range of 0 to 1 to a color.

The data for most of these color schemes comes from http://geography.uoregon.edu/datagraphics/color_scales.htm

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TColorItem  
Class TColorCollection  
Class TUserDefinedColorSchemeItem  
Class TUserDefinedColorSchemeCollection  
Class TColorParameters  

Functions and Procedures

function FracLookup(Fraction: real; const LookUpTable: array of TColorArray): TColor;
function FracToBlueDarkOrange(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToBlueGray(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToBlueGreen(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToBlueOrange(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToBlueRed(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToBrownBlue(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToGreenMagenta(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToSpectrum(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToBlue_OrangeRed(Fraction, ColorAdjustmentFactor: real): TColor;
function FracToLightBlue_DarkBlue(Fraction, ColorAdjustmentFactor: real): TColor;
function ModifiedSpectralScheme(Fraction, ColorAdjustmentFactor: real): TColor;
function SteppedSequential(Fraction, ColorAdjustmentFactor: real): TColor;

Types

TColorComponents = (...);
TColorArray = array[TColorComponents] of double;
TColorComparer = TComparer<TColorItem>;
TColorList = TList<TColorItem>;

Constants

MaxColorScheme = 11;

Description

Functions and Procedures

function FracLookup(Fraction: real; const LookUpTable: array of TColorArray): TColor;

FracLookup converts Fraction to a TColor using a user-supplied look-up table. The color that is returned will be interpolated from value in the table.

function FracToBlueDarkOrange(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBlueDarkOrange converts Fraction to a color ranging from blue to dark orange.

function FracToBlueGray(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBlueGray converts Fraction to a color ranging from blue to gray.

function FracToBlueGreen(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBlueGreen converts Fraction to a color ranging from blue to green.

function FracToBlueOrange(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBlueOrange converts Fraction to a color ranging from blue to orange.

function FracToBlueRed(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBlueRed converts Fraction to a color ranging from blue to red.

function FracToBrownBlue(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBrownBlue converts Fraction to a color ranging from brown to blue.

function FracToGreenMagenta(Fraction, ColorAdjustmentFactor: real): TColor;

FracToGreenMagenta converts Fraction to a color ranging from green to magenta.

function FracToSpectrum(Fraction, ColorAdjustmentFactor: real): TColor;

FracToSpectrum converts Fraction to a color ranging from red to green to blue.

function FracToBlue_OrangeRed(Fraction, ColorAdjustmentFactor: real): TColor;

FracToBlue_OrangeRed converts Fraction to a color ranging from blue to orangish red.

function FracToLightBlue_DarkBlue(Fraction, ColorAdjustmentFactor: real): TColor;

FracToLightBlue_DarkBlue converts Fraction to a color ranging from light blue to dark blue.

function ModifiedSpectralScheme(Fraction, ColorAdjustmentFactor: real): TColor;

ModifiedSpectralScheme converts Fraction to a spectral color but avoiding green.

function SteppedSequential(Fraction, ColorAdjustmentFactor: real): TColor;

SteppedSequential converts Fraction to a color using a scheme that varies the base color between one of five choices and within each of those choices varies the chroma and intensity.

Types

TColorComponents = (...);

TColorComponents is used to index TColorArray.

Values
  • ccRed:  
  • ccGreen:  
  • ccBlue:  
TColorArray = array[TColorComponents] of double;

TColorArray is used to specify a color. Each member of TColorArray is a fraction in the range 0 to 1 inclusive. Each fraction represents the degree of saturation with a particular color component For example, the following specifies a color in which the red component is 25% saturated, the green component is 50% saturated and the blue component is 75% saturated.

   var
     ColorArray: TColorArray;
   begin
     ColorArray[ccRed]   := 0.25;
     ColorArray[ccGreen] := 0.50;
     ColorArray[ccBlue]  := 0.75;
   end;
   

TColorComparer = TComparer<TColorItem>;
 
TColorList = TList<TColorItem>;
 

Constants

MaxColorScheme = 11;
 

Generated by PasDoc 0.12.1 on 2013-05-13 15:41:29