1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. package Themes.Palette is 
  10.  
  11.     -- This is the Tango color theme 
  12.     -- http://tango.freedesktop.org/ 
  13.     -- 
  14.     -- Adobe Kuler 
  15.     -- http://kuler.adobe.com/ 
  16.  
  17.     type Base_Color is ( 
  18.         Black,       White, 
  19.         Transparent, Magenta, 
  20.  
  21.         Butter1,     Butter2,    Butter3, 
  22.         Orange1,     Orange2,    Orange3, 
  23.         Chocolate1,  Chocolate2, Chocolate3, 
  24.         Chameleon1,  Chameleon2, Chameleon3, 
  25.         Skyblue1,    Skyblue2,   Skyblue3, 
  26.         Plum1,       Plum2,      Plum3, 
  27.         Scarlet1,    Scarlet2,   Scarlet3, 
  28.         Chrome1,     Chrome2,    Chrome3, 
  29.         Chrome4,     Chrome5,    Chrome6 
  30.     ); 
  31.  
  32.     type Base_Colors_Array is array(Base_Color) of Allegro_Color; 
  33.  
  34.     -- Initialize must be called before base_colors can be used. 
  35.     base_colors : Base_Colors_Array; 
  36.  
  37.     ---------------------------------------------------------------------------- 
  38.  
  39.     -- Initializes the base_colors array. This can't be called until the Allegro 
  40.     -- color depth has been set. 
  41.     procedure Initialize; 
  42.  
  43.     ---------------------------------------------------------------------------- 
  44.     -- Color manipulation functions 
  45.  
  46.     -- Returns True if the colors compare within tolerance bounds. If any of the 
  47.     -- components of the colors differ by more than 'tolerance', the comparison 
  48.     -- will fail 
  49.     function Compare( a, b : Allegro_Color; tolerance : Natural := 0 ) return Boolean; 
  50.  
  51.     -- Returns the foreground color adjusted for contrast against the background. 
  52.     function Contrast( fg, bg : Allegro_Color; ratio : Float := 1.75 ) return Allegro_Color; 
  53.  
  54.     -- Returns white or black, depending on the brightness of the background. 
  55.     function Hard_Contrast( bg : Allegro_Color ) return Allegro_Color; 
  56.  
  57.     -- Returns a color which is lighter or darker than the input. The color will 
  58.     -- be darker where 0 < factor < 1 and lighter where factor > 1. 
  59.     function Lighten( color : Allegro_Color; factor : Float ) return Allegro_Color; 
  60.  
  61.     function Make_Grey( brightness : Natural ) return Allegro_Color; 
  62.  
  63. end Themes.Palette;