Click here to Skip to main content
15,906,097 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I'm working alot with RGB and ARGB colors and
need to make an app to convert RGB color codes
to ARGB.

Please any help would be appriciated.

This is what I tried:

        byte Alpha;
        byte Red;
        byte Green;
        byte Blue;

        int RGB;
....

        private long ARGB()
        {
            long functionReturnValue = 0;
            if (Alpha > 127)
            {
                functionReturnValue = ((Alpha - 128) * 0x1000000 | 0x80000000) | Red | (Green * 0x100L) | (Blue * 0x10000);
            }
            else
            {
                functionReturnValue = (Alpha * 0x1000000) | Red | (Green * 0x100L) | (Blue * 0x10000);
            }
            return functionReturnValue;
            RGB = Alpha & Red & Green & Blue;
        }
Posted

1 solution

please read this[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900