Home

0xRRGGBB

0xRRGGBB is a common hexadecimal notation used in programming to represent a 24-bit color value. After the 0x prefix, six hexadecimal digits encode the red, green, and blue components in the order red, green, blue. Each pair ranges from 00 to FF, corresponding to 0 to 255 for the color channels. For example, 0xFF0000 denotes pure red, 0x00FF00 denotes pure green, and 0x0000FF denotes pure blue; 0x80A0C0 encodes a mid-level red, a medium-high green, and a light blue.

In typical use, the 0xRRGGBB value is stored as a 24-bit integer. To extract the individual components

The 0xRRGGBB scheme is distinct from CSS color notations, which use #RRGGBB or rgb() functions. In graphics

in
code,
red
can
be
obtained
with
(color
>>
16)
&
0xFF,
green
with
(color
>>
8)
&
0xFF,
and
blue
with
color
&
0xFF.
When
alpha
(transparency)
is
required,
32-bit
formats
may
adopt
layouts
such
as
0xAARRGGBB
or
0xRRGGBBAA,
where
an
additional
byte
encodes
alpha,
but
these
are
separate
from
the
plain
0xRRGGBB
notation.
programming,
0xRRGGBB
is
favored
for
its
compact
representation
and
ease
of
bitwise
manipulation,
especially
in
shaders,
game
engines,
and
low-level
graphics
libraries.
The
convention
is
widely
understood,
though
exact
endianness
and
packing
can
vary
between
platforms
and
APIs.