ReactOS  0.4.14-dev-342-gdc047f9
cardcolor.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAKE_PALETTERGB(colref)   (0x02000000 | colref)
 

Functions

COLORREF ColorScaleRGB (const COLORREF Col1, const COLORREF Col2, const double Ratio)
 
COLORREF ColorScaleHSL (const COLORREF Col1, const COLORREF Col2, const double Ratio)
 
COLORREF ColorDarker (COLORREF col, double ratio)
 
COLORREF ColorLighter (COLORREF col, double ratio)
 
COLORREF ScaleLumRGB (COLORREF col1, double ratio)
 

Macro Definition Documentation

◆ MAKE_PALETTERGB

#define MAKE_PALETTERGB (   colref)    (0x02000000 | colref)

Definition at line 17 of file cardcolor.h.

Function Documentation

◆ ColorDarker()

COLORREF ColorDarker ( COLORREF  col,
double  ratio 
)

Definition at line 188 of file cardcolor.cpp.

189 {
190  return ColorScaleHSL(col, RGB(0,0,0), ratio);
191 }
#define RGB(r, g, b)
Definition: wingdi.h:2935
COLORREF ColorScaleHSL(const COLORREF Col1, const COLORREF Col2, const double Ratio)
Definition: cardcolor.cpp:131

◆ ColorLighter()

COLORREF ColorLighter ( COLORREF  col,
double  ratio 
)

Definition at line 193 of file cardcolor.cpp.

194 {
195  return ColorScaleHSL(col, RGB(255,255,255), ratio);
196 }
#define RGB(r, g, b)
Definition: wingdi.h:2935
COLORREF ColorScaleHSL(const COLORREF Col1, const COLORREF Col2, const double Ratio)
Definition: cardcolor.cpp:131

◆ ColorScaleHSL()

COLORREF ColorScaleHSL ( const COLORREF  Col1,
const COLORREF  Col2,
const double  Ratio 
)

Definition at line 131 of file cardcolor.cpp.

132 {
133  static double H1, H2, S1, S2, L1, L2;
134 
135  if (Ratio<=0) return Col1; // Ratio parameter must be between 0 and 1
136  else if (Ratio>=1) return Col2;
137 
138  RGBtoHLS( Col1, &H1, &L1, &S1);
139  RGBtoHLS( Col2, &H2, &L2, &S2);
140  return HLStoRGB( H1+(H2-H1)*Ratio, L1+(L2-L1)*Ratio, S1+(S2-S1)*Ratio );
141 }
#define H2(x, y, z)
Definition: md5.c:54
#define S1(x)
Definition: test.h:191
#define S2(x)
Definition: test.h:192
void RGBtoHLS(const COLORREF rgb, double *H, double *L, double *S)
Definition: cardcolor.cpp:29
COLORREF HLStoRGB(const double H, const double L, const double S)
Definition: cardcolor.cpp:90

Referenced by ColorDarker(), and ColorLighter().

◆ ColorScaleRGB()

COLORREF ColorScaleRGB ( const COLORREF  Col1,
const COLORREF  Col2,
const double  Ratio 
)

Definition at line 154 of file cardcolor.cpp.

156  {
157  int R1=(Col1)&0xFF, G1=(Col1>>8)&0xFF, B1=(Col1>>16)&0xFF;
158  int R2=(Col2)&0xFF, G2=(Col2>>8)&0xFF, B2=(Col2>>16)&0xFF;
159 
160  if (Ratio<=0) return Col1; // Ratio parameter must be between 0 and 1
161  else if (Ratio>=1) return Col2;
162 
163 /* return RGB(
164  (R1 + (R2 - R1) * (Ratio + 0.02) + 0.5), // rounding
165  (G1 + (G2 - G1) * (Ratio - 0.00) + 0.5),
166  (B1 + (B2 - B1) * (Ratio + 0.05) + 0.5)
167  );*/
168 
169  /*double r = Ratio;
170  if(Col2 == 0)
171  r = 1-Ratio;
172  else
173  r = 1+Ratio;
174  R1 = (int)(double(R1) * r + 0.5);
175  G1 = (int)(double(G1) * r + 0.5);
176  B1 = (int)(double(B1) * r + 0.5);
177  return RGB(R1,G1,B1);*/
178 
179  return RGB(
180  (R1 + (R2 - R1) * (Ratio + 0.02) + 0.5), // rounding
181  (G1 + (G2 - G1) * (Ratio - 0.00) + 0.5),
182  (B1 + (B2 - B1) * (Ratio + 0.05) + 0.5)
183  );
184 }
#define R2(v, w, x, y, z, i)
Definition: sha1.c:37
#define R1(v, w, x, y, z, i)
Definition: sha1.c:36
#define RGB(r, g, b)
Definition: wingdi.h:2935

Referenced by CardButton::GetFace(), CardButton::GetHighlight(), CardButton::GetShadow(), GetSinkCols(), and CardWindow::SetBackColor().

◆ ScaleLumRGB()

COLORREF ScaleLumRGB ( COLORREF  col1,
double  ratio 
)