cwidget  0.5.16
colors.h
Go to the documentation of this file.
00001 // colors.h  -*-c++-*-
00002 //
00003 //  Copyright 1999-2001, 2004-2005, 2008 Daniel Burrows
00004 //
00005 //  This program is free software; you can redistribute it and/or modify
00006 //  it under the terms of the GNU General Public License as published by
00007 //  the Free Software Foundation; either version 2 of the License, or
00008 //  (at your option) any later version.
00009 //
00010 //  This program is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //  GNU General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU General Public License
00016 //  along with this program; see the file COPYING.  If not, write to
00017 //  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018 //  Boston, MA 02111-1307, USA.
00019 //
00020 //  Manages color allocation so as to allow any combination of
00021 //  foreground/background colors to be used.  If there aren't enough
00022 //  color pairs available to handle all color combinations, this will
00023 //  act as though no colors are available.  NOTE: colors whose
00024 //  foreground and background are the same will be reduced to an
00025 //  arbitrary color of that background; it is expected that the caller
00026 //  will apply A_INVIS to such colors.  This is done to conserve color
00027 //  pairs so as to allow the use of the 'default' color.
00028 
00029 #ifndef COLORS_H
00030 #define COLORS_H
00031 
00044 namespace cwidget
00045 {
00051   namespace config
00052   {
00060     void init_colors();
00061 
00063     int get_color_pair(short fg, short bg);
00064 
00072     int mix_color(short color, short fg, short bg);
00073   }
00074 }
00075 
00076 #endif