Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
00001 /**************************************************************************************/ 00002 /* */ 00003 /* Visualization Library */ 00004 /* http://www.visualizationlibrary.com */ 00005 /* */ 00006 /* Copyright (c) 2005-2010, Michele Bosi */ 00007 /* All rights reserved. */ 00008 /* */ 00009 /* Redistribution and use in source and binary forms, with or without modification, */ 00010 /* are permitted provided that the following conditions are met: */ 00011 /* */ 00012 /* - Redistributions of source code must retain the above copyright notice, this */ 00013 /* list of conditions and the following disclaimer. */ 00014 /* */ 00015 /* - Redistributions in binary form must reproduce the above copyright notice, this */ 00016 /* list of conditions and the following disclaimer in the documentation and/or */ 00017 /* other materials provided with the distribution. */ 00018 /* */ 00019 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */ 00020 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ 00021 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ 00022 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */ 00023 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ 00024 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */ 00025 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ 00026 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ 00027 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ 00028 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 00029 /* */ 00030 /**************************************************************************************/ 00031 00032 #ifndef Color_INCLUDE_ONCE 00033 #define Color_INCLUDE_ONCE 00034 00035 // for more colors see: http://en.wikipedia.org/wiki/List_of_colors 00036 00037 #include <vlCore/Vector4.hpp> 00038 00039 namespace vl 00040 { 00041 inline fvec4 makeColor(unsigned int color) 00042 { 00043 fvec4 c; 00044 c.r() = float(((color >> 24) & 0xFF) / 255.0f); 00045 c.g() = float(((color >> 16) & 0xFF) / 255.0f); 00046 c.b() = float(((color >> 8) & 0xFF) / 255.0f); 00047 c.a() = float(((color >> 0) & 0xFF) / 255.0f); 00048 return c; 00049 } 00050 00051 inline bool isValidColor( const fvec4& color ) { return color.a() >= 0; } 00052 00053 static fvec4 invalid_color = fvec4(0, 0, 0, -1); 00054 static fvec4 black = makeColor(0x000000FF); 00055 static fvec4 white = makeColor(0xFFFFFFFF); 00056 static fvec4 red = makeColor(0xFF0000FF); 00057 static fvec4 crimson = makeColor(0xDC143CFF); 00058 static fvec4 violet = makeColor(0x9400D3FF); 00059 static fvec4 orange = makeColor(0xFFA000FF); 00060 static fvec4 yellow = makeColor(0xFFFF00FF); 00061 static fvec4 gold = makeColor(0xFFD700FF); 00062 static fvec4 green = makeColor(0x00FF00FF); 00063 static fvec4 lightgreen = makeColor(0x90FF90FF); 00064 static fvec4 darkgreen = makeColor(0x006400FF); 00065 static fvec4 olivegreen = makeColor(0x556B2FFF); 00066 static fvec4 blue = makeColor(0x0000FFFF); 00067 static fvec4 darkblue = makeColor(0x00008BFF); 00068 static fvec4 royalblue = makeColor(0x4169E1FF); 00069 static fvec4 skyblue = makeColor(0x5555FFFF); 00070 static fvec4 midnightblue = makeColor(0x191970FF); 00071 static fvec4 fuchsia = makeColor(0xFF00FFFF); 00072 static fvec4 aqua = makeColor(0x00FFFFFF); 00073 static fvec4 pink = makeColor(0xffb6c1FF); 00074 static fvec4 salmonpink = makeColor(0xFF91A4FF); 00075 static fvec4 turquoise = makeColor(0x30D5C8FF); 00076 static fvec4 darkturquoise = makeColor(0x008080FF); 00077 static fvec4 gray = makeColor(0xA9A9A9FF); 00078 static fvec4 lightgray = makeColor(0xD3D3D3FF); 00079 static fvec4 darkgray = makeColor(0x808080FF); 00080 00081 } 00082 00083 #endif