ColorF::ColorF(FLOAT, FLOAT, FLOAT, FLOAT)(FLOAT, FLOAT, FLOAT, FLOAT) constructor

Instantiates a new instance of the ColorF class that contains the specified red, green, blue, and alpha values.

Syntax


ColorF(FLOAT, FLOAT, FLOAT, FLOAT)(
   FLOAT red,
   FLOAT green,
   FLOAT blue,
   FLOAT alpha = 1.0
);

Parameters

red

Type: FLOAT

The red component of the color to be constructed.

green

Type: FLOAT

The green component of the color to be constructed.

blue

Type: FLOAT

The blue component of the color to be constructed.

alpha

Type: FLOAT

The alpha value of the color to be constructed. An alpha channel value ranges from 0.0 to 1.0, where 0.0 represents a fully transparent color and 1.0 represents a fully opaque color.The default value is 1.0.

Examples

The following example specifies the red, green, blue, and alpha values for a color.


ID2D1SolidColorBrush *pGridBrush = NULL;
hr = pCompatibleRenderTarget->CreateSolidColorBrush(
    D2D1::ColorF(D2D1::ColorF(0.93f, 0.94f, 0.96f, 1.0f)),
    &pGridBrush
    );


Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

D2D1

Header

D2d1helper.h

Library

D2d1.lib

DLL

D2d1.dll

See also

ColorF
Brushes Overview

 

 

Show: