Index

Package: Palette

Description

package Themes.Palette is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Types

Base_Color

type Base_Color is (
        Black,       White,
        Transparent, Magenta,

        Butter1,     Butter2,    Butter3,
        Orange1,     Orange2,    Orange3,
        Chocolate1,  Chocolate2, Chocolate3,
        Chameleon1,  Chameleon2, Chameleon3,
        Skyblue1,    Skyblue2,   Skyblue3,
        Plum1,       Plum2,      Plum3,
        Scarlet1,    Scarlet2,   Scarlet3,
        Chrome1,     Chrome2,    Chrome3,
        Chrome4,     Chrome5,    Chrome6
    );

Base_Colors_Array

type Base_Colors_Array is array(Base_Color) of Allegro_Color;

Constants & Global variables

base_colors (Base_Colors_Array)

base_colors : Base_Colors_Array;
Initialize must be called before base_colors can be used.

Subprograms & Entries

Initialize

procedure Initialize;
Initializes the base_colors array. This can't be called until the Allegro color depth has been set.

Compare

function Compare
( a, b: Allegro_Color;
tolerance: Natural := 0 ) return Boolean;
Returns True if the colors compare within tolerance bounds. If any of the components of the colors differ by more than 'tolerance', the comparison will fail

Contrast

function Contrast
( fg, bg: Allegro_Color;
ratio: Float := 1.75 ) return Allegro_Color;
Returns the foreground color adjusted for contrast against the background.

Hard_Contrast

function Hard_Contrast
( bg: Allegro_Color ) return Allegro_Color;
Returns white or black, depending on the brightness of the background.

Lighten

function Lighten
( color: Allegro_Color;
factor: Float ) return Allegro_Color;
Returns a color which is lighter or darker than the input. The color will be darker where 0 < factor < 1 and lighter where factor > 1.

Make_Grey

function Make_Grey
( brightness: Natural ) return Allegro_Color;