TFTタッチスクリーンを使用したプロジェクトに取り組んでいます。この画面にはライブラリが含まれています。しかし、いくつか読んだ後、私はまだ何かを得ません。ライブラリには、色に関する定義がいくつかあります。
/* some RGB color definitions */
#define Black 0x0000 /* 0, 0, 0 */
#define Navy 0x000F /* 0, 0, 128 */
#define DarkGreen 0x03E0 /* 0, 128, 0 */
#define DarkCyan 0x03EF /* 0, 128, 128 */
#define Maroon 0x7800 /* 128, 0, 0 */
#define Purple 0x780F /* 128, 0, 128 */
#define Olive 0x7BE0 /* 128, 128, 0 */
#define LightGrey 0xC618 /* 192, 192, 192 */
#define DarkGrey 0x7BEF /* 128, 128, 128 */
#define Blue 0x001F /* 0, 0, 255 */
#define Green 0x07E0 /* 0, 255, 0 */
#define Cyan 0x07FF /* 0, 255, 255 */
#define Red 0xF800 /* 255, 0, 0 */
#define Magenta 0xF81F /* 255, 0, 255 */
#define Yellow 0xFFE0 /* 255, 255, 0 */
#define White 0xFFFF /* 255, 255, 255 */
#define Orange 0xFD20 /* 255, 165, 0 */
#define GreenYellow 0xAFE5 /* 173, 255, 47 */
#define Pink 0xF81F
それらは16ビットカラーです。しかし、どのようにして 0, 128, 128 (ダーク シアン) から 0x03EF になるのでしょうか。つまり、16 ビット カラーを uint16 に変換する方法を教えてください。ライブラリにいくつかの色を追加したいだけなので、コードで答えを出す必要はありません。オンラインコンバーターへのリンク(私は見つけられませんでした)も大丈夫です:)
ありがとう