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 |
|
reference |
05/31/2018 |
Describes the red, green, blue, and alpha components of a color.
typedef D2D_COLOR_F D2D1_COLOR_F;
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.
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
);
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 |
|