Computer Science, asked by healthpetips, 10 months ago

How do I convert the hex color code to rgb color using c++?


Anonymous: ___k off

Answers

Answered by Anonymous
1

.\huge\red{Hello\:Mate\:!!}

int rgb;

StrToIntEx(L"0x0000FF", STIF_SUPPORT_HEX, &rgb);

COLORREF clr = (((rgb & 0x000000FF) << 16) | (rgb & 0x0000FF00) | ((rgb & 0x00FF0000) >> 16));

// Test R, G, B

BYTE nRed = GetRValue(clr);

BYTE nGreen = GetGValue(clr);

BYTE nBlue = GetBValue(clr);

&lt;marquee behavior=move bgcolor=pink&gt; &lt;h1&gt; Follow me ❤&lt;/h1&gt;&lt;/marquee&gt;

Answered by aqleemabeena
0

Answer:

I actually don't know the answer but I think that it would be like this:

COLORREF clr = (((rgb & 0x000000FF) << 16) | (rgb & 0x0000FF00) | ((rgb & 0x00FF0000) >> 16))

Explanation:

Don't know whether its correct or not but did try it out! Hope that it would be the correct answer to your query!

Similar questions