Пример #1
0
CColor CColor::modulate ( const CColor& color ) const
{
    unsigned char R = static_cast<unsigned char> ( getRed()   * color.getRed()   / 255 );
    unsigned char G = static_cast<unsigned char> ( getGreen() * color.getGreen() / 255 );
    unsigned char B = static_cast<unsigned char> ( getBlue()  * color.getBlue()  / 255 );
    unsigned char A = static_cast<unsigned char> ( getAlpha() * color.getAlpha() / 255 );

    return CColor ( R , G , B , A );
}
Пример #2
0
CColor CColor::operator - ( const CColor& color ) const
{
    int R = getRed()   - color.getRed();
    int G = getGreen() - color.getGreen();
    int B = getBlue()  - color.getBlue();
    int A = getAlpha() - color.getAlpha();

    CColor newc;
    newc.setInt ( R , G , B , A );

    return newc;
}