AnimalCrossingQR.AC.Palette.GetColorIndexByCode C# (CSharp) Method

GetColorIndexByCode() public static method

public static GetColorIndexByCode ( byte code ) : int
code byte
return int
        public static int GetColorIndexByCode(byte code)
        {
            // Grayscale colors
            if ((code & 0x0F) == 0x0F)
                return 144 + (code >> 4);

            // Other colors
            return ((code & 0xF0) >> 4) * 9 + (code & 0x0F);
        }