ColorUtils Class Reference

#include <mw/gulutil.h>

Link against: egul.lib

class ColorUtils

Detailed Description

Provides static functions for manipulating colours.

See also: TDisplayMode

Member Enumeration Documentation

Enum TBitmapOrientation

The orientation of a bitmap.

EnumeratorValueDescription
EBitmapOrientationVertical

The bitmap is vertical.

EBitmapOrientationHorizontal

The bitmap is horizontal.

Member Function Documentation

ColorAdjust ( TRgb, TInt )

IMPORT_C TRgbColorAdjust(TRgbaColor,
TIntaPercentage
)[static]

Brightens or darkens a 24-bit colour by a percentage.

If the percentage given is less than 100%, a darker colour will be returned. The algorithm brightens or darkens each of the R, G and B channels equally.

ParameterDescription
aColorInput colour.
aPercentagePercentage by which to adjust the input colour.

Returns: The adjusted colour.

CreateGradientBitmapL ( CFbsBitmap &, const RWsSession &, TInt, TBitmapOrientation, TRgb, TRgb )

IMPORT_C voidCreateGradientBitmapL(CFbsBitmap &aBitmap,
const RWsSession &aWs,
TIntaBreadth,
TBitmapOrientationaOrientation,
TRgbaStartColor,
TRgbaEndColor
)[static]

Creates a CFbsBitmap containing a colour gradient.

To create a gradient, the end colour aEndColor must be different to the start colour aStartingColor.

ParameterDescription
aBitmapBitmap which on return contains the colour gradient.
aWsHandle to a window server session.
aBreadthThe width or the height of the bitmap, depending on the orientation.
aOrientationThe bitmap's orientation (vertical or horizontal).
aStartColorThe start color.
aEndColorThe end color.

CreateSystemColorListL ( RFs & )

IMPORT_C CColorList *CreateSystemColorListL(RFs &aFs)[static]

CreateSystemColorListL ( RFs &, const CColorList & )

IMPORT_C CColorList *CreateSystemColorListL(RFs &aFs,
const CColorList &aColorList
)[static]

GetRgbDerivedBorderColors ( TGulBorder::TColors &, TRgb, TDisplayMode )

IMPORT_C voidGetRgbDerivedBorderColors(TGulBorder::TColors &aBorderColors,
TRgbaBackgroundColor,
TDisplayModeaMode
)[static]

Gets the colours to use for a control's border.

Lighter and darker tones in the border are derived from the specified TRgb background colour using an algorithm operating on the RGB value of this color or a lookup table, depending on the display mode aMode. It sets the values of the aBorderColors members iBack, iLight, iMidlight, iMid, and iDark.

ParameterDescription
aBorderColorsOn return, the derived border colours.
aBackgroundColorThe control's background colour.
aModeThe display mode.

RgbDarkerColor ( TRgb, TDisplayMode )

IMPORT_C TRgbRgbDarkerColor(TRgbaRgb,
TDisplayModeaMode
)[static]

Creates a darker color.

ParameterDescription
aRgbThe RGB color.
aModeThe display mode, which indicates the screen output of the colour e.g. 256 colour display mode (8 bpp).

Returns: The darker colour.

RgbLighterColor ( TRgb, TDisplayMode )

IMPORT_C TRgbRgbLighterColor(TRgbaRgb,
TDisplayModeaMode
)[static]

Creates a lighter colour.

ParameterDescription
aRgbThe Rgb colour.
aModeThe display mode, which indicates the screen output of the colour e.g. 256 colour display mode (8 bpp).

Returns: The lighter colour.

RgbMidDarkerColor ( TRgb, TDisplayMode )

IMPORT_C TRgbRgbMidDarkerColor(TRgbaRgb,
TDisplayModeaMode
)[static]

Creates a medium dark version of the colour.

This function darkens the colour 50% less than RgbDarkerColor().

ParameterDescription
aRgbThe Rgb color.
aModeThe display mode, which indicates the screen output of the colour e.g. 256 colour display mode (8 bpp).

Returns: The medium dark colour.

UpdateSystemColorListL ( RFs &, CColorList & )

IMPORT_C voidUpdateSystemColorListL(RFs &aFs,
CColorList &aColorList
)[static]