Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Info
  3. Community
  4. Development
  5. myReactOS

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

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

Definition at line 153 of file cardcolor.cpp.

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

00155                                             {
00156     int R1=(Col1)&0xFF, G1=(Col1>>8)&0xFF, B1=(Col1>>16)&0xFF;
00157     int R2=(Col2)&0xFF, G2=(Col2>>8)&0xFF, B2=(Col2>>16)&0xFF;
00158 
00159     if (Ratio<=0) return Col1;    // Ratio parameter must be between 0 and 1
00160     else if (Ratio>=1) return Col2;
00161 
00162 /*    return RGB(
00163                (R1 + (R2 - R1) * (Ratio + 0.02) + 0.5),        // rounding
00164                (G1 + (G2 - G1) * (Ratio - 0.00) + 0.5),
00165                (B1 + (B2 - B1) * (Ratio + 0.05) + 0.5)
00166                );*/
00167 
00168     /*double r = Ratio;
00169     if(Col2 == 0)
00170         r = 1-Ratio;
00171     else
00172         r = 1+Ratio;
00173     R1 = (int)(double(R1) * r + 0.5);
00174     G1 = (int)(double(G1) * r + 0.5);
00175     B1 = (int)(double(B1) * r + 0.5);
00176     return RGB(R1,G1,B1);*/
00177 
00178     return RGB(
00179                (R1 + (R2 - R1) * (Ratio + 0.02) + 0.5),        // rounding
00180                (G1 + (G2 - G1) * (Ratio - 0.00) + 0.5),
00181                (B1 + (B2 - B1) * (Ratio + 0.05) + 0.5)
00182                );
00183 }


Generated on Thu Mar 18 09:35:14 2010 for ReactOS by doxygen 1.6.2

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.