0x3RRGGBB, 0x5RGBxxx, and 0x6xxxRGB should all have alpha of 0.5. 0x7xxxxxx is totally invisible. Please note that 0xRRGGBB does not exist as a color standard. There would be no way to distinguish between standard (non-RGB) colors and colors with 0 for RR and GG.
You might want to look at LDView's color-calculating code here (specifically LDLPalette::getAnyColorInfo). Even if you don't write C++ code, you should be able to interpret the calculations.
You might want to look at LDView's color-calculating code here (specifically LDLPalette::getAnyColorInfo). Even if you don't write C++ code, you should be able to interpret the calculations.