⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 canvascolor.h

📁 C++&datastructure书籍源码,以前外教提供现在与大家共享
💻 H
字号:
#ifndef _CANVASCOLOR_H
#define _CANVASCOLOR_H

#include <string>
using namespace std;
#include "colors.h"

class CanvasColor
{
  public:
    CanvasColor(unsigned char Red = 0,
		unsigned char Green = 0,
		unsigned char Blue = 0)
    { 
        myRed = Red;  myGreen = Green;  myBlue = Blue; 
    }
    
    CanvasColor(const color& c)
    {
       myRed = c.ucRed; myGreen = c.ucGreen; myBlue = c.ucBlue;
    }

    operator color() const
    {
	return color(myRed,myGreen,myBlue);    
    }

    string tostring( ) const;
	
    unsigned char myRed;
    unsigned char myGreen;
    unsigned char myBlue;

    static const color SNOW;
    static const color GHOSTWHITE;
    static const color WHITESMOKE;
    static const color GAINSBORO;
    static const color FLORALWHITE;
    static const color OLDLACE;
    static const color LINEN;
    static const color ANTIQUEWHITE;
    static const color PAPAYAWHIP;
    static const color BLANCHEDALMOND;
    static const color BISQUE;
    static const color PEACHPUFF;
    static const color NAVAJOWHITE;
    static const color MOCCASIN;
    static const color CORNSILK;
    static const color IVORY;
    static const color LEMONCHIFFON;
    static const color SEASHELL;
    static const color HONEYDEW;
    static const color MINTCREAM;
    static const color AZURE;
    static const color ALICEBLUE;
    static const color LAVENDER;
    static const color LAVENDERBLUSH;
    static const color MISTYROSE;
    static const color WHITE;
    static const color BLACK;
    static const color DARKSLATEGRAY;
    static const color DARKSLATEGREY;
    static const color DIMGRAY;
    static const color DIMGREY;
    static const color SLATEGRAY;
    static const color SLATEGREY;
    static const color LIGHTSLATEGRAY;
    static const color LIGHTSLATEGREY;
    static const color GRAY;
    static const color GREY;
    static const color LIGHTGREY;
    static const color LIGHTGRAY;
    static const color MIDNIGHTBLUE;
    static const color NAVY;
    static const color NAVYBLUE;
    static const color CORNFLOWERBLUE;
    static const color DARKSLATEBLUE;
    static const color SLATEBLUE;
    static const color MEDIUMSLATEBLUE;
    static const color LIGHTSLATEBLUE;
    static const color MEDIUMBLUE;
    static const color ROYALBLUE;
    static const color BLUE;
    static const color DODGERBLUE;
    static const color DEEPSKYBLUE;
    static const color SKYBLUE;
    static const color LIGHTSKYBLUE;
    static const color STEELBLUE;
    static const color LIGHTSTEELBLUE;
    static const color LIGHTBLUE;
    static const color POWDERBLUE;
    static const color PALETURQUOISE;
    static const color DARKTURQUOISE;
    static const color MEDIUMTURQUOISE;
    static const color TURQUOISE;
    static const color CYAN;
    static const color LIGHTCYAN;
    static const color CADETBLUE;
    static const color MEDIUMAQUAMARINE;
    static const color AQUAMARINE;
    static const color DARKGREEN;
    static const color DARKOLIVEGREEN;
    static const color DARKSEAGREEN;
    static const color SEAGREEN;
    static const color MEDIUMSEAGREEN;
    static const color LIGHTSEAGREEN;
    static const color PALEGREEN;
    static const color SPRINGGREEN;
    static const color LAWNGREEN;
    static const color GREEN;
    static const color CHARTREUSE;
    static const color MEDIUMSPRINGGREEN;
    static const color GREENYELLOW;
    static const color LIMEGREEN;
    static const color YELLOWGREEN;
    static const color FORESTGREEN;
    static const color OLIVEDRAB;
    static const color DARKKHAKI;
    static const color KHAKI;
    static const color PALEGOLDENROD;
    static const color LIGHTGOLDENRODYELLOW;
    static const color LIGHTYELLOW;
    static const color YELLOW;
    static const color GOLD;
    static const color LIGHTGOLDENROD;
    static const color GOLDENROD;
    static const color DARKGOLDENROD;
    static const color ROSYBROWN;
    static const color INDIAN;
    static const color INDIANRED;
    static const color SADDLEBROWN;
    static const color SIENNA;
    static const color PERU;
    static const color BURLYWOOD;
    static const color BEIGE;
    static const color WHEAT;
    static const color SANDYBROWN;
    static const color TAN;
    static const color CHOCOLATE;
    static const color FIREBRICK;
    static const color BROWN;
    static const color DARKSALMON;
    static const color SALMON;
    static const color LIGHTSALMON;
    static const color ORANGE;
    static const color DARKORANGE;
    static const color CORAL;
    static const color LIGHTCORAL;
    static const color TOMATO;
    static const color ORANGERED;
    static const color RED;
    static const color HOTPINK;
    static const color DEEPPINK;
    static const color PINK;
    static const color LIGHTPINK;
    static const color PALEVIOLETRED;
    static const color MAROON;
    static const color MEDIUMVIOLETRED;
    static const color VIOLETRED;
    static const color MAGENTA;
    static const color VIOLET;
    static const color PLUM;
    static const color ORCHID;
    static const color MEDIUMORCHID;
    static const color DARKORCHID;
    static const color DARKVIOLET;
    static const color BLUEVIOLET;
    static const color PURPLE;
    static const color MEDIUMPURPLE;
    static const color THISTLE;
    static const color DARKGREY;
    static const color DARKGRAY;
    static const color DARKBLUE;
    static const color DARKCYAN;
    static const color DARKMAGENTA;
    static const color DARKRED;
    static const color LIGHTGREEN;
    static const color INDIGO;
};

bool operator == (const color& lhs, const color& rhs);

#endif;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -