About Practical Color Formats for Embedded & System Development
Beyond web CSS, many platforms require colors in very specific binary or integer formats. Embedded displays and microcontrollers like Arduino and STM32 use RGB565 (16-bit) — a compact two-byte format that packs red into 5 bits, green into 6 bits, and blue into 5 bits. Game engines, graphics APIs, and hardware framebuffers often work directly with 24-bit binary (eight 0s and 1s per channel). Linux terminals and CLI tools use ANSI escape sequences to render color in the terminal. And Android's Java/Kotlin ecosystem requires colors as an ARGB integer where the alpha channel comes first.
This tool converts any HEX color into all these system-level formats: RGB565 (16-bit packed integer), binary (24-bit string), ANSI escape code for terminal output, signed 32-bit integer for bit-manipulation APIs, CSS RGBA for web use, and Java/Android ARGB (0xFFRRGGBB notation). Every value is click-to-copy for instant use.
This tool is especially valuable for firmware engineers, game developers, hardware hackers, and Android developers who need a color in a non-standard binary or integer representation — without doing the bit-shifting math by hand. Enter your HEX code once and get every embedded format instantly.
Frequently Asked Questions
What is RGB565 and when is it used? +
RGB565 is a compact 16-bit color format that packs a full RGB color into just two bytes: 5 bits for red, 6 bits for green (because the human eye is most sensitive to green), and 5 bits for blue. It is the standard color format for embedded displays — TFT LCD screens driven by microcontrollers like Arduino, STM32, and ESP32 almost always use RGB565 because it halves the memory needed compared to full 24-bit RGB. Game Boy Advance, the original Nintendo DS, and many retro handhelds also used 16-bit packed color. When uploading a bitmap to a display driver or writing a framebuffer, you will typically need the 16-bit hex value this tool generates (e.g. 0xE5BD for #E07A5F).
What is 24-bit binary color? +
24-bit binary is the raw bit representation of an RGB color — 8 bits (one byte) per channel. The binary string for #E07A5F is 11100000 01111010 01011111. This representation is useful in graphics programming, hardware description languages (VHDL/Verilog), embedded systems documentation, and educational contexts where you want to show what a color literally looks like in memory. Bitwise manipulation of colors (blending, masking, extracting channels) is much easier to reason about in binary. The tool formats it with spaces between each byte for readability.
How do ANSI terminal escape codes display color? +
ANSI escape sequences are special character sequences that instruct a compatible terminal emulator to change text color, background color, style, and more. For true-color (24-bit) terminals, the format is: \033[38;2;R;G;Bm for foreground text color, where R, G, B are decimal channel values. For #E07A5F that becomes \033[38;2;224;122;95m. To reset color back to default use \033[0m. Modern terminals like iTerm2, Windows Terminal, and most Linux terminal emulators support true-color ANSI. This is commonly used in CLI tools, log colorizers, build scripts, and interactive TUI applications built with Node.js, Python (colorama/rich), or Go (lipgloss).
What is a color integer and where is it used? +
A color integer is simply the decimal (base-10) representation of a color's 24-bit hex value. For #E07A5F, the integer is 14,710,367. This format is used in environments that don't support hex notation but do accept integers — certain graphics APIs, database fields storing color values, some game engine scripting languages, and programming contests. You can reconstruct R, G, B from an integer using bitwise operations: R = (int >> 16) & 0xFF, G = (int >> 8) & 0xFF, B = int & 0xFF. The integer and hex are two ways to write the exact same number — just in different bases.
What is the difference between CSS RGBA and a HEX color? +
HEX (#E07A5F) and CSS rgba() (rgba(224, 122, 95, 1)) express the same color — the difference is notation and functionality. HEX is more compact and the most common format in web design and design tools. rgba() makes it trivial to add transparency by changing the fourth parameter (alpha) to a value between 0 and 1, e.g. rgba(224, 122, 95, 0.5) for 50% opacity. You cannot express transparency in a standard 6-digit HEX — you need the 8-character HEX extension (#E07A5F80) for that. Both are supported in all modern browsers and CSS preprocessors.
What is Java/Android ARGB format? +
Android and Java represent colors in ARGB order — Alpha, Red, Green, Blue — where the alpha channel comes first. The format is 0xFFRRGGBB: 0xFF means fully opaque (255), followed by the six-digit HEX. For #E07A5F: 0xFFE07A5F. Use this in Java/Kotlin: int color = 0xFFE07A5F; or Color.parseColor("#E07A5F"). In Android Jetpack Compose: Color(0xFFE07A5F). In the Android XML resource file (res/values/colors.xml): <color name="brand">#E07A5F</color> (Android automatically treats this as FF alpha). The ARGB notation is necessary when calling Android API methods that accept an integer color value — passing a 6-digit HEX integer directly would give you an unexpectedly transparent result.
Why does embedded display code need a different color format than web CSS? +
Web browsers and embedded microcontrollers use fundamentally different color pipelines. A browser parses text, understands CSS, and has a full color management stack. A microcontroller driving a TFT display sends raw pixel data directly to the display controller over SPI or I2C — there is no CSS parser in between. The display controller expects pixels in RGB565 (16-bit) or sometimes RGB888 (24-bit) binary format, not a text string like "#E07A5F". Similarly, framebuffers in bare-metal graphics programming expect integers or bit-packed values. This is why developers working with Arduino, Raspberry Pi Pico, STM32, or custom PCB displays need a converter like this one — to translate web-style HEX colors into the binary formats their hardware actually understands.
How do I use a color from this tool in an Arduino sketch? +
Most Arduino TFT display libraries (Adafruit GFX, TFT_eSPI, LVGL) accept colors in RGB565 format. Copy the RGB565 value from this tool (e.g. 0xE5BD for #E07A5F) and use it directly in your sketch: tft.fillScreen(0xE5BD); or define it as a constant: #define BRAND_COLOR 0xE5BD. Some libraries also offer a helper macro Color565(r, g, b) — but using the pre-computed value from this tool is more efficient since the conversion is done at compile time rather than runtime. For LVGL, use lv_color_hex(0xE07A5F) or lv_color_make(224, 122, 95) for RGB888 mode. Always check your display library's documentation to confirm whether it expects RGB565 or RGB888 input.