OpenWalnut
1.4.0
|
00001 //--------------------------------------------------------------------------- 00002 // 00003 // Project: OpenWalnut ( http://www.openwalnut.org ) 00004 // 00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS 00006 // For more information see http://www.openwalnut.org/copying 00007 // 00008 // This file is part of OpenWalnut. 00009 // 00010 // OpenWalnut is free software: you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as published by 00012 // the Free Software Foundation, either version 3 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // OpenWalnut is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public License 00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>. 00022 // 00023 //--------------------------------------------------------------------------- 00024 00025 #ifndef WCOLOR_H 00026 #define WCOLOR_H 00027 00028 #include <osg/Vec4> 00029 #include <osg/io_utils> // for the operator<< and operator>> for Vec4 00030 00031 00032 00033 /** 00034 * Represents a RGBA Color. 00035 */ 00036 typedef osg::Vec4 WColor; 00037 00038 /** 00039 * Creates a color from a hue, saturation and value (HSV). 00040 * 00041 * \ingroup Color utils 00042 * 00043 * \param h hue 00044 * \param s saturation 00045 * \param v value 00046 * 00047 * \return The same color but in rgba format. 00048 */ 00049 WColor convertHSVtoRGBA( double h, double s, double v ); 00050 00051 /** 00052 * Computes the inverse of this color in means of RGB space. The alpha value is untouched. 00053 * 00054 * \ingroup Color utils 00055 * 00056 * \param other The color (RGBA) from which the inverse should be calculated. 00057 */ 00058 WColor inverseColor( const WColor& other ); 00059 00060 /** 00061 * Some default colors. 00062 */ 00063 namespace defaultColor 00064 { 00065 // \cond Suppress_Doxygen 00066 static const WColor DARKRED( 0.5, 0.0, 0.0, 1.0 ); //!< Default for dark red 00067 static const WColor RED( 1.0, 0.0, 0.0, 1.0 ); //!< Default for red 00068 static const WColor LIGHTRED( 1.0, 0.5, 0.5, 1.0 ); //!< Default for lighter red 00069 00070 static const WColor DARKGREEN( 0.0, 0.5, 0.0, 1.0 ); //!< Default for a dark green 00071 static const WColor GREEN( 0.0, 1.0, 0.0, 1.0 ); //!< Default for green 00072 static const WColor LIGHTGREEN( 0.5, 1.0, 0.5, 1.0 ); //!< Default for lighter green 00073 00074 static const WColor DARKBLUE( 0.0, 0.0, 0.5, 1.0 ); //!< Default for blue 00075 static const WColor BLUE( 0.0, 0.0, 1.0, 1.0 ); //!< Default for blue 00076 static const WColor LIGHTBLUE( 0.5, 0.5, 1.0, 1.0 ); //!< Default for blue 00077 00078 static const WColor DARKYELLOW( 0.5, 0.5, 0.0, 1.0 ); //!< Default for yellow 00079 static const WColor YELLOW( 1.0, 1.0, 0.0, 1.0 ); //!< Default for yellow 00080 static const WColor LIGHTYELLOW( 1.0, 1.0, 0.5, 1.0 ); //!< Default for yellow 00081 00082 static const WColor ORANGE( 1.0, 0.5, 0.0, 1.0 ); //!< Default for orange 00083 00084 static const WColor VIOLET( 0.5, 0.0, 0.5, 1.0 ); //!< Default for violet (darker pink) 00085 static const WColor PINK( 1.0, 0.0, 1.0, 1.0 ); //!< Default for pink 00086 00087 static const WColor TEAL( 0.0, 0.5, 0.5, 1.0 ); //!< Default for darker cyan (teal) 00088 static const WColor CYAN( 0.0, 1.0, 1.0, 1.0 ); //!< Default for cyan 00089 00090 static const WColor BLACK( 0.0, 0.0, 0.0, 1.0 ); //!< Default for black 00091 static const WColor GRAY25( 0.25, 0.25, 0.25, 1.0 ); //!< Default for gray 00092 static const WColor GRAY50( 0.5, 0.5, 0.5, 1.0 ); //!< Default for gray 00093 static const WColor GRAY75( 0.75, 0.75, 0.75, 1.0 ); //!< Default for gray 00094 static const WColor WHITE( 1.0, 1.0, 1.0, 1.0 ); //!< Default for white 00095 static const WColor TRANSPARENT( 1.0, 1.0, 1.0, 0.0 ); //!< Completely transparent -- NOTE: this does not belong to the default palette 00096 // \endcond 00097 00098 /** 00099 * The size of the default palette 00100 */ 00101 static const size_t DefaultPaletteSize = 22; 00102 00103 /** 00104 * This array is a simple palette definition containing the above colors. This palette is probably not very usable for all your special 00105 * needs. DO NOT add thousand other palettes here. Define them for yourself, in your module. 00106 */ 00107 extern const WColor DefaultPalette[22]; 00108 } 00109 00110 #endif // WCOLOR_H