1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
#include<iostream>
#include<string.h>
using namespace std;
class color
{
public:
int p,n,ne = 0;
int R,G,B;
int set_color(int x,int y,int z)
{
x = R;
y = G;
z = B;
}
color();
color(int p, int n, int ne)
{
if(p >= 255)
{
p = 255;
}
else(p = p);
if(n >= 255)
{
n = 255;
}
else(n = n);
if(ne >= 255)
{
ne = 255;
}
else(ne = ne);
}
int add(int a,int b,int c)
{
R = max(R,a);
G = max(G,b);
B = max(B,c);
}
int mix(int a,int b,int c)
{
R = (R + a) /2 ;
G = (G + b) /2 ;
B = (B + c) /2 ;
}
};
int main()
{
const color Black(0,0,0);
const color White(255,255,255);
const color SkyBlue(135,206,235);
const color SeaGreen(46,139,87);
const color Gold(255,215,0);
const color Chocolate(210,105,30);
const color DarkGrey(75,75,75);
color Custom(White);
Custom.set_color(DarkGrey);
Custom.mix(DarkGrey);
Custom.mix(SkyBlue);
color CreamyMix(White);
CreamyMix.mix(SkyBlue);
CreamyMix.mix(SeaGreen);
CreamyMix.mix(White);
CreamyMix.mix(White);
color mixes[5];
mixes[0] = SkyBlue;
mixes[0].add(SeaGreen);
mixes[0].mix(Black);
mixes[1].set(Chocolate.B(),SeaGreen.R(),DarkGrey.G());
mixes[1].mix(Gold);
mixes[2] = White;
mixes[2].add(Black);
mixes[2].add(Gold);
mixes[3].set(Chocolate.R(),Gold.G(),SeaGreen.B());
mixes[3].add(SkyBlue);
mixes[4] = mixes[3];
mixes[4].mix(Black);
mixes[4].mix(Black);
return Black.R();
};
|