示例#1
0
        }         // HILO8

        internal static ushort GetRgb565(Color c)
        {
            int val = 0;

            // val += c.A >> 8; // unused
            val += Bclim.Convert8To5(c.B) >> 3;
            val += (c.G >> 2) << 5;
            val += Bclim.Convert8To5(c.R) << 10;
            return((ushort)val);
        }         // RGB565
示例#2
0
        }         // RGB565

        // RGB8
        internal static ushort GetRgba5551(Color c)
        {
            int val = 0;

            val += (byte)(c.A > 0x80
                                                                ? 1
                                                                : 0);
            val += Bclim.Convert8To5(c.R) << 11;
            val += Bclim.Convert8To5(c.G) << 6;
            val += Bclim.Convert8To5(c.B) << 1;
            ushort v = (ushort)val;

            return(v);
        }         // RGBA5551