Color Tools
Convert hex to Android ARGB, check WCAG contrast, and generate Material Design palettes. All live in your browser.
- Runs locally
- Works offline
- No upload
Color tools
Hex ↔ ARGB
WCAG Contrast Checker
Material Palette Generator
About this tool
Three color utilities in one page: a bidirectional hex to 0xAARRGGBB converter with swatch preview, a WCAG contrast checker that shows the ratio and conformance level with a live text preview, and a Material Design palette generator that produces the full 10-stop scale from any base color.
Everything runs in your browser. No color values are sent to a server.
ARGB in Android
- Android stores colors as
intvalues in 0xAARRGGBB format. The first byte is alpha (00 = fully transparent, FF = fully opaque). - The most common fully opaque red is
0xFFFF0000; a 50% transparent blue is0x800000FF. - In Kotlin or Java you can write these as
Color.parseColor("#FF0000")or as integer literals like0xFFFF0000.toInt(). - Jetpack Compose uses
Color(0xFF3A6A68)notation, which maps directly to the 0xAARRGGBB format.
WCAG contrast levels
- AAA (7:1+): enhanced contrast for normal text. Suitable for users with low vision.
- AA (4.5:1+): minimum for normal text in most accessibility standards.
- AA Large (3:1+): minimum for large text (18pt+ or 14pt+ bold).
- Fail (<3:1): insufficient contrast for text at any size.
About the Android Color Tools
Working with color on Android involves three recurring problems: translating the CSS hex values your design tools produce into the 0xAARRGGBB integer format the framework expects, verifying that your chosen foreground and background combination meets accessibility standards, and building out a full tonal palette from a single brand color. This page handles all three without leaving your browser.
Hex to ARGB conversion
Android's Color class and Jetpack Compose both use 32-bit ARGB integers. The alpha channel sits in the two most significant hex digits, followed by red, green, and blue. A designer's #3A6A68 becomes 0xFF3A6A68 in code, where the FF prefix signals fully opaque. When you have a partially transparent color, you encode it as 0x803A6A68 for 50% opacity. The converter handles all shorthand forms (#RGB, #RRGGBB, and #AARRGGBB) and works in both directions.
WCAG contrast checking
The Web Content Accessibility Guidelines (WCAG) 2.1 define contrast as the ratio between the relative luminance of the lighter color plus 0.05 and the relative luminance of the darker color plus 0.05. That formula gives a range of 1:1 (no contrast) to 21:1 (black on white). Google's Material Design guidelines and Android's accessibility documentation both reference the AA threshold of 4.5:1 for body text. The checker computes the ratio instantly and tells you which level your pair reaches.
Material palette generator
Material Design organizes colors into 10-stop tonal palettes labeled 50 through 900. Stop 500 is the primary brand color; lower numbers are progressively lighter tints toward white, and higher numbers are darker shades toward black. You can use the generated hex values directly in your colors.xml resource file or in a Compose MaterialTheme color scheme. Click any swatch to copy its hex value to the clipboard.
Frequently asked questions
Why does Android use 0xAARRGGBB instead of CSS #RRGGBBAA?
Android's color integer format predates the CSS Color Level 4 specification that added the trailing-alpha #RRGGBBAA syntax. The ARGB layout puts alpha in the most significant byte, which made masking and bit-shifting operations efficient on early Android hardware. You will still find it throughout the framework today.
What WCAG level should my Android app target?
Google recommends AA as the minimum, which means a 4.5:1 contrast ratio for normal text and 3:1 for large text. Targeting AAA (7:1) provides the best experience for users with low vision and is worth pursuing for primary content. The contrast checker will show you exactly where your color pair lands.
Can I use these hex values directly in colors.xml?
Yes. Android colors.xml accepts #RRGGBB and #AARRGGBB strings. The hex output from this tool (without the 0x prefix) pastes directly into a color resource. For example, #3A6A68 becomes <color name="primary">#3A6A68</color>.
How accurate is the Material palette generator?
The palette uses linear interpolation toward white (for tints) and toward black (for shades). This approximates the visual result of the official Material Design color system, but the official tooling uses a more complex perceptual color model. Use this generator for quick prototyping; for production design systems you may want to refine the values in Figma's Material Theme Builder or a similar tool.