📄 color.h
字号:
/* $Id: color.h,v 1.22 2004/01/02 15:42:43 mbn Exp $
**
** ClanLib Game SDK
** Copyright (C) 2003 The ClanLib Team
** For a total list of contributers see the file CREDITS.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**
*/
//! clanDisplay="Display 2D"
//! header=display.h
#ifndef header_color
#define header_color
#if _MSC_VER > 1000
#pragma once
#endif
#include <string>
#include <vector>
//: Color description class.
//- !group=Display/Display 2D!
//- !header=display.h!
class CL_Color
{
//! Construction:
public:
//: Constructs a color.
//- <p>Color components are specified in the range 0 to 255.</p>
//- <p>An alpha value of 0 means complete transparency, while 255 means completely opaque (solid).</p>
//param red: Red color component.
//param green: Green color component.
//param blue: Blue color component.
//param alpha: Alpha (transparency) color component.
CL_Color() : color(0) { return; }
CL_Color(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha = 255)
: color((alpha<<24) + (red<<16) + (green<<8) + blue) { return; }
//! Attributes:
public:
//: Returns the alpha color component, in the range 0-255.
unsigned int get_alpha() const { return (color >> 24) & 255; }
//: Returns the red color component, in the range 0-255.
unsigned int get_red() const { return (color >> 16) & 255; }
//: Returns the green color component, in the range 0-255.
unsigned int get_green() const { return (color >> 8) & 255; }
//: Returns the blue color component, in the range 0-255.
unsigned int get_blue() const { return color & 255; }
//: Returns the color in ARGB8888 format.
operator unsigned int() const { return color; }
//: Color in ARGB8888 format.
unsigned int color;
//! Statics:
public:
//: <img src="../images/aliceblue-chip.png" width=16 height=16 /> rgb(240, 248, 255).
static CL_Color aliceblue;
//: <img src="../images/antiquewhite-chip.png" width=16 height=16 /> rgb(250, 235, 215).
static CL_Color antiquewhite;
//: <img src="../images/aqua-chip.png" width=16 height=16 /> rgb( 0, 255, 255).
static CL_Color aqua;
//: <img src="../images/aquamarine-chip.png" width=16 height=16 /> rgb(127, 255, 212).
static CL_Color aquamarine;
//: <img src="../images/azure-chip.png" width=16 height=16 /> rgb(240, 255, 255).
static CL_Color azure;
//: <img src="../images/beige-chip.png" width=16 height=16 /> rgb(245, 245, 220).
static CL_Color beige;
//: <img src="../images/bisque-chip.png" width=16 height=16 /> rgb(255, 228, 196).
static CL_Color bisque;
//: <img src="../images/black-chip.png" width=16 height=16 /> rgb( 0, 0, 0).
static CL_Color black;
//: <img src="../images/blanchedalmond-chip.png" width=16 height=16 /> rgb(255, 235, 205).
static CL_Color blanchedalmond;
//: <img src="../images/blue-chip.png" width=16 height=16 /> rgb( 0, 0, 255).
static CL_Color blue;
//: <img src="../images/blueviolet-chip.png" width=16 height=16 /> rgb(138, 43, 226).
static CL_Color blueviolet;
//: <img src="../images/brown-chip.png" width=16 height=16 /> rgb(165, 42, 42).
static CL_Color brown;
//: <img src="../images/burlywood-chip.png" width=16 height=16 /> rgb(222, 184, 135).
static CL_Color burlywood;
//: <img src="../images/cadetblue-chip.png" width=16 height=16 /> rgb( 95, 158, 160).
static CL_Color cadetblue;
//: <img src="../images/chartreuse-chip.png" width=16 height=16 /> rgb(127, 255, 0).
static CL_Color chartreuse;
//: <img src="../images/chocolate-chip.png" width=16 height=16 /> rgb(210, 105, 30).
static CL_Color chocolate;
//: <img src="../images/coral-chip.png" width=16 height=16 /> rgb(255, 127, 80).
static CL_Color coral;
//: <img src="../images/cornflowerblue-chip.png" width=16 height=16 /> rgb(100, 149, 237).
static CL_Color cornflowerblue;
//: <img src="../images/cornsilk-chip.png" width=16 height=16 /> rgb(255, 248, 220).
static CL_Color cornsilk;
//: <img src="../images/crimson-chip.png" width=16 height=16 /> rgb(220, 20, 60).
static CL_Color crimson;
//: <img src="../images/cyan-chip.png" width=16 height=16 /> rgb( 0, 255, 255).
static CL_Color cyan;
//: <img src="../images/darkblue-chip.png" width=16 height=16 /> rgb( 0, 0, 139).
static CL_Color darkblue;
//: <img src="../images/darkcyan-chip.png" width=16 height=16 /> rgb( 0, 139, 139).
static CL_Color darkcyan;
//: <img src="../images/darkgoldenrod-chip.png" width=16 height=16 /> rgb(184, 134, 11).
static CL_Color darkgoldenrod;
//: <img src="../images/darkgray-chip.png" width=16 height=16 /> rgb(169, 169, 169).
static CL_Color darkgray;
//: <img src="../images/darkgreen-chip.png" width=16 height=16 /> rgb( 0, 100, 0).
static CL_Color darkgreen;
//: <img src="../images/darkgrey-chip.png" width=16 height=16 /> rgb(169, 169, 169).
static CL_Color darkgrey;
//: <img src="../images/darkkhaki-chip.png" width=16 height=16 /> rgb(189, 183, 107).
static CL_Color darkkhaki;
//: <img src="../images/darkmagenta-chip.png" width=16 height=16 /> rgb(139, 0, 139).
static CL_Color darkmagenta;
//: <img src="../images/darkolivegreen-chip.png" width=16 height=16 /> rgb( 85, 107, 47).
static CL_Color darkolivegreen;
//: <img src="../images/darkorange-chip.png" width=16 height=16 /> rgb(255, 140, 0).
static CL_Color darkorange;
//: <img src="../images/darkorchid-chip.png" width=16 height=16 /> rgb(153, 50, 204).
static CL_Color darkorchid;
//: <img src="../images/darkred-chip.png" width=16 height=16 /> rgb(139, 0, 0).
static CL_Color darkred;
//: <img src="../images/darksalmon-chip.png" width=16 height=16 /> rgb(233, 150, 122).
static CL_Color darksalmon;
//: <img src="../images/darkseagreen-chip.png" width=16 height=16 /> rgb(143, 188, 143).
static CL_Color darkseagreen;
//: <img src="../images/darkslateblue-chip.png" width=16 height=16 /> rgb( 72, 61, 139).
static CL_Color darkslateblue;
//: <img src="../images/darkslategray-chip.png" width=16 height=16 /> rgb( 47, 79, 79).
static CL_Color darkslategray;
//: <img src="../images/darkslategrey-chip.png" width=16 height=16 /> rgb( 47, 79, 79).
static CL_Color darkslategrey;
//: <img src="../images/darkturquoise-chip.png" width=16 height=16 /> rgb( 0, 206, 209).
static CL_Color darkturquoise;
//: <img src="../images/darkviolet-chip.png" width=16 height=16 /> rgb(148, 0, 211).
static CL_Color darkviolet;
//: <img src="../images/deeppink-chip.png" width=16 height=16 /> rgb(255, 20, 147).
static CL_Color deeppink;
//: <img src="../images/deepskyblue-chip.png" width=16 height=16 /> rgb( 0, 191, 255).
static CL_Color deepskyblue;
//: <img src="../images/dimgray-chip.png" width=16 height=16 /> rgb(105, 105, 105).
static CL_Color dimgray;
//: <img src="../images/dimgrey-chip.png" width=16 height=16 /> rgb(105, 105, 105).
static CL_Color dimgrey;
//: <img src="../images/dodgerblue-chip.png" width=16 height=16 /> rgb( 30, 144, 255).
static CL_Color dodgerblue;
//: <img src="../images/firebrick-chip.png" width=16 height=16 /> rgb(178, 34, 34).
static CL_Color firebrick;
//: <img src="../images/floralwhite-chip.png" width=16 height=16 /> rgb(255, 250, 240).
static CL_Color floralwhite;
//: <img src="../images/forestgreen-chip.png" width=16 height=16 /> rgb( 34, 139, 34).
static CL_Color forestgreen;
//: <img src="../images/fuchsia-chip.png" width=16 height=16 /> rgb(255, 0, 255).
static CL_Color fuchsia;
//: <img src="../images/gainsboro-chip.png" width=16 height=16 /> rgb(220, 220, 220).
static CL_Color gainsboro;
//: <img src="../images/ghostwhite-chip.png" width=16 height=16 /> rgb(248, 248, 255).
static CL_Color ghostwhite;
//: <img src="../images/gold-chip.png" width=16 height=16 /> rgb(255, 215, 0).
static CL_Color gold;
//: <img src="../images/goldenrod-chip.png" width=16 height=16 /> rgb(218, 165, 32).
static CL_Color goldenrod;
//: <img src="../images/gray-chip.png" width=16 height=16 /> rgb(128, 128, 128).
static CL_Color gray;
//: <img src="../images/grey-chip.png" width=16 height=16 /> rgb(128, 128, 128).
static CL_Color grey;
//: <img src="../images/green-chip.png" width=16 height=16 /> rgb( 0, 128, 0).
static CL_Color green;
//: <img src="../images/greenyellow-chip.png" width=16 height=16 /> rgb(173, 255, 47).
static CL_Color greenyellow;
//: <img src="../images/honeydew-chip.png" width=16 height=16 /> rgb(240, 255, 240).
static CL_Color honeydew;
//: <img src="../images/hotpink-chip.png" width=16 height=16 /> rgb(255, 105, 180).
static CL_Color hotpink;
//: <img src="../images/indianred-chip.png" width=16 height=16 /> rgb(205, 92, 92).
static CL_Color indianred;
//: <img src="../images/indigo-chip.png" width=16 height=16 /> rgb( 75, 0, 130).
static CL_Color indigo;
//: <img src="../images/ivory-chip.png" width=16 height=16 /> rgb(255, 255, 240).
static CL_Color ivory;
//: <img src="../images/khaki-chip.png" width=16 height=16 /> rgb(240, 230, 140).
static CL_Color khaki;
//: <img src="../images/lavender-chip.png" width=16 height=16 /> rgb(230, 230, 250).
static CL_Color lavender;
//: <img src="../images/lavenderblush-chip.png" width=16 height=16 /> rgb(255, 240, 245).
static CL_Color lavenderblush;
//: <img src="../images/lawngreen-chip.png" width=16 height=16 /> rgb(124, 252, 0).
static CL_Color lawngreen;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -