Conic Gradient Generator
Build conic gradients — pie charts, colour wheels and sweeps.
Convert a HEX colour to the integer forms Android, Java and Unity want.
The values appear here
HEX to Decimal Color turns a colour into every integer form a platform might want: decimal channels, the packed 24-bit value, the 32-bit ARGB integer signed and unsigned, and normalised floats for shaders.
Plenty of environments want a colour as a single number rather than a string. Android takes a signed 32-bit ARGB integer, Java AWT takes an unsigned RGB one, Unity and many game engines take 0–1 floats, and shaders take normalised vectors.
This converts a HEX code into all of them at once: the three channels in decimal, the packed 24-bit RGB integer, the 32-bit ARGB value in both signed and unsigned form, and the float triple with as many digits as you need.
The signed form is the one that causes trouble. Any colour with an alpha above 50% has the top bit of the 32-bit value set, which in a signed integer means it is negative — which is why Android colours so often appear as large negative numbers in logs. Both forms are shown side by side so it is clear they are the same 32 bits read two ways.
Android colours appear negative because the top alpha bit is set in a signed int. Both readings are shown as the same 32 bits.
Android puts alpha first, CSS puts it last. Getting it backwards gives the wrong transparency, so both are labelled explicitly.
The 0–1 triple Unity, OpenGL and shaders expect, with a note about linear versus sRGB.
Paste an integer from a log or a config file and get the colour back.
Each form says which environment wants it, so there is no guessing which number to copy.
Six or eight digits — the alpha is used for the ARGB forms.
Decimal channels, packed RGB, signed and unsigned ARGB, and normalised floats.
Each is labelled with the platform that expects it.
Paste an integer and get the HEX code it represents.
Because Color.parseColor returns a signed 32-bit integer, and any colour that is more than half opaque sets the top bit. 0xFF4F46E5 is -11774235 when read as signed. It is the same value, read differently.
The three channels shifted into one number: red times 65536, plus green times 256, plus blue. #4F46E5 becomes 5195493. It is what Java AWT, many APIs and a lot of config formats expect.
Android and Java put alpha first (ARGB). CSS eight-digit HEX and most graphics APIs put it last (RGBA). Getting the order wrong gives you a colour with the wrong transparency, so both are shown here explicitly.
Unity, OpenGL, shaders and most 3D tools take channels as 0–1 floats. Note that they usually expect linear values, so a colour destined for a shader may need linearising first.
What people who use the HEX to Decimal Color think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the HEX to Decimal Color. It takes half a minute and no account.
Write the first reviewBuild conic gradients — pie charts, colour wheels and sweeps.
Nudge a colour until it passes WCAG, keeping its hue.
Build tints, shades and tones from one colour.
Fill headline text with a gradient, and keep it selectable.
Work out the solid colour a translucent layer really produces.
Find the true complement of any colour, and the near ones.
Convert CIELAB to HEX and RGB, and measure ΔE between colours.
Convert LCH to HEX and RGB — LAB in polar form, as CSS uses it.