📅  最后修改于: 2022-03-11 14:46:21.501000             🧑  作者: Mango
# To encode
rgb = red;
rgb = (rgb << 8) + green;
rgb = (rgb << 8) + blue;
# To decode
red = (rgb >> 16) & 0xFF;
green = (rgb >> 8) & 0xFF;
blue = rgb & 0xFF;