Beispiel #1
0
// Check the luminance and return true if this colour
// nearer to black than white and vice versa.
bool CColour::NearBlack()
{
    int h,s,l;
    GetHSL(h,s,l);

    return ( (l < 120) ? true : false );
}
Beispiel #2
0
void CColour::Lighten(int Amount /* = 1 */)
{
    int h,s,l;
    GetHSL(h,s,l);

    l += Amount;
    if (l > 240)
        l = 240;

    SetHSL(h,s,l);
}
Beispiel #3
0
void CColour::Darken(int Amount /* = 1 */)
{
    int h,s,l;
    GetHSL(h,s,l);

    l -= Amount;
    if (l < 0)
        l = 0;

    SetHSL(h,s,l);
}
float wxColourExt::HslLuminosity() const
{
    GetHSL(&H0, &S0, &L0);
    return L0;
}
float wxColourExt::HslSaturation() const
{
    GetHSL(&H0, &S0, &L0);
    return S0;
}
float wxColourExt::HslHue() const
{
    GetHSL(&H0, &S0, &L0);
    return H0;
}