Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 2.63 KB

d2d1-color-f.md

File metadata and controls

79 lines (46 loc) · 2.63 KB
title description ms.assetid keywords ms.topic ms.date
D2D1_COLOR_F (D2DBaseTypes.h)
Describes the red, green, blue, and alpha components of a color. | D2D1_COLOR_F (D2DBaseTypes.h)
564d4f41-2da7-49ed-b85a-d1070d662b40
D2D1_COLOR_F
reference
05/31/2018

D2D1_COLOR_F

Describes the red, green, blue, and alpha components of a color.

typedef D2D_COLOR_F D2D1_COLOR_F;

Remarks

D2D1_COLOR_F is a typedef for D2D_COLOR_F, which is itself a typedef for D3DCOLORVALUE. For information about the members provided by D2D1_COLOR_F, see D3DCOLORVALUE.

The ColorF class provides a set of predefined colors and helper functions for defining colors. For more information, see the ColorF reference.

Examples

The following example uses the ColorF class to specify a predefined color (black) when creating an ID2D1SolidColorBrush.

hr = m_pRenderTarget->CreateSolidColorBrush(
    D2D1::ColorF(D2D1::ColorF::Black, 1.0f),
    &m_pBlackBrush
    );

The following example uses the ColorF class to specify a color using red, green, blue, and alpha values.

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

Requirements

Requirement Value
Minimum supported client
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Minimum supported phone
Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]
Header
D2DBaseTypes.h (include D2d1.h)

See also

D3DCOLORVALUE

ColorF