Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: gulutil.h
Link against: egul.lib

Class ColorUtils

ColorUtils

Support

Supported from 6.0

Description

Provides utility functions for manipulating colours.

Defined in ColorUtils:
ColorAdjust(), CreateGradientBitmapL(), CreateSystemColorListL(), EBitmapOrientationHorizontal, EBitmapOrientationVertical, GetRgbDerivedBorderColors(), RgbDarkerColor(), RgbLighterColor(), RgbMidDarkerColor(), TBitmapOrientation, UpdateSystemColorListL()

See also:


Member functions


ColorAdjust()

static TRgb ColorAdjust(TRgb aColor,TInt aPercentage);

Description

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.

Parameters

TRgb aColor

Input colour.

TInt aPercentage

Percentage of the input brightness.

Return value

TRgb

The adjusted colour.


CreateGradientBitmapL()

static void CreateGradientBitmapL(CFbsBitmap& aBitmap,RWsSession& aWs,TInt aBreadth,TBitmapOrientation aOrientation,TRgb aStartColor,TRgb aEndColor);

Description

Creates a CFbsBitmap for the application title and returns it in aBitmap. Gets the length of the bitmap and orientation. To create a gradient you can set the end colour aEndColor as different to the starting colour aStartingColor. However, if you set the colors as equal the bitmap will be a solid one.

Parameters

CFbsBitmap& aBitmap

Bitmap for the gradient.

RWsSession& aWs

Handle to window server session.

TInt aBreadth

The breadth of the gradient.

TBitmapOrientation aOrientation

The bitmap orientation.

TRgb aStartColor

The start color.

TRgb aEndColor

The end color.


CreateSystemColorListL()

static CColorList* CreateSystemColorListL(RFs& aFs);

Description

Creates a system color list, which is a palette of colours used by the system.

Parameters

RFs& aFs

The file server session.

Return value

CColorList*

Pointer to the color list.


CreateSystemColorListL()

static CColorList* CreateSystemColorListL(RFs& aFs,const CColorList& aColorList);

Description

Creates a system color list from an existing colour list.

Parameters

RFs& aFs

The file server session.

const CColorList& aColorList

The color list.

Return value

CColorList*

Pointer to the color list.


UpdateSystemColorListL()

static void UpdateSystemColorListL(RFs& aFs,CColorList& aColorList);

Description

Updates the system color list.

Parameters

RFs& aFs

The file server session.

CColorList& aColorList

The color list.


GetRgbDerivedBorderColors()

static void GetRgbDerivedBorderColors(TGulBorder::TColors& aBorderColors,TRgb aBackgroundColor,TDisplayMode aMode);

Description

Gets the TRgb color of derived border colors.

Lighter and darker tones in the set are derived from the background color aBackgroundColor 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.

Parameters

TGulBorder::TColors& aBorderColors

On return, the control’s border colours.

TRgb aBackgroundColor

The background colour.

TDisplayMode aMode

The display mode.


RgbDarkerColor()

static TRgb RgbDarkerColor(TRgb aRgb,TDisplayMode aMode);

Description

Creates a darker color.

Parameters

TRgb aRgb

The RGB color.

TDisplayMode aMode

The display mode, which indicates the screen output of the colour e.g. 256 colour display mode (8 bpp).

Return value

TRgb

The darker colour.


RgbMidDarkerColor()

static TRgb RgbMidDarkerColor(TRgb aRgb,TDisplayMode aMode);

Description

Creates a medium dark version of the colour.

Parameters

TRgb aRgb

The Rgb color.

TDisplayMode aMode

The display mode, which indicates the screen output of the colour e.g. 256 colour display mode (8 bpp).

Return value

TRgb

The medium dark colour.


RgbLighterColor()

static TRgb RgbLighterColor(TRgb aRgb,TDisplayMode aMode);

Description

Creates a lighter colour.

Parameters

TRgb aRgb

The Rgb colour.

TDisplayMode aMode

The display mode, which indicates the screen output of the colour e.g. 256 colour display mode (8 bpp).

Return value

TRgb

The lighter colour.

[Top]


Enumerations


Enum TBitmapOrientation

TBitmapOrientation

Description

An enumeration that indicates the orientation of a bitmap.

EBitmapOrientationVertical

The bitmap is vertical.

EBitmapOrientationHorizontal

The bitmap is horizontal.