-1

I am learning win32 api from MSDN. I came across this topic(http://msdn.microsoft.com/en-us/library/windows/desktop/ff684180(v=vs.85).aspx) which talked about the colors in direct2d. But there are only 8 main colors for which RGB code is given. What is the RGB code for every possible color in direct2d ???

Thanks in advance.

Apoorv
  • 373
  • 1
  • 5
  • 15
  • Typical video cards can render 16.7 million actual colors. D2D color uses floating point and so the range is theoretically that of the resolution of a `float`, cubed, however any given theoretical color will be mapped to the closest actual color that the display device can handle. Either way, a full list of every possible color is not really practical. – Jonathan Potter Jun 13 '13 at 07:13

1 Answers1

0

Also, worth noting that colors in Direct2D are expressed in rgba format as 1.0 normalized float values.

For example:

ID2D1RenderTarget * pRT; // passed in or created.  
// Of course the code below should be between pRT->BeginDraw(), pRT->EndDraw() calls.

ID2D1SolidColorBrush* pbr = NULL;
// red, blue, green, alpha are float values from 0.f to 1.f
D2D1_COLOR_F colr = D2D1::ColorF( red, green, blue, alpha));

pRT->CreateSolidColorBrush( colr, &pbr );

// now you have a color you can use for rendering
D2D1_RECT_F rcF = D2D1::RectF( 10.f, 10.f, 650.f, 490.f );
pRT->FillRectangle(rcF, pBrush);
kalbr
  • 144
  • 6