T

Trinnovate

Pioneering Robotics & AI Solutions for Defence & Industrial Automation

Loading innovation...

trinnovate-logo-black
<- Back to Tools

RGB565 Color Picker & Converter

Pick a 24-bit color and instantly get the 16-bit RGB565 value used by STM32, Arduino displays, and embedded GUIs. Copy-ready C code provided.

Pick a Color

RGB565

0x4A3C

Hi / Lo Bytes

0x4A / 0x3C

MSB-first SPI often uses hi then lo

Preview

RGB888 #4F46E5

Bit Packing (5-6-5)

R5: 01001
G6: 010001
B5: 11100

Copy-ready C Code

#include <Arduino.h>
#define TFT_LED_PIN 9

// Packed RGB565
const uint16_t COLOR = 0x4A3C;

// Split bytes for SPI transfers
const uint8_t COLOR_HI = 0x4A;
const uint8_t COLOR_LO = 0x3C;

void setup() {
  pinMode(TFT_LED_PIN, OUTPUT);
}

void loop() {
  // send COLOR_HI then COLOR_LO when driving TFT buffers
}

RGB565 packs bits as RRRRRGGGGGGBBBBB.

Most displays expect big-endian bytes (MSB first). Swap hi/lo if your bus is little-endian.