RGB Composite Color Code Visualizer
PHP Program by Jay Tanner

Enter RGB Composite Color Code Value:      


RGB COMPOSITE COLOR SAMPLE
0

0
R
00

0
G
00

0
B
00
   
 
 
 
   
 
   
 
 
 
   
16777215
NEGATIVE or INVERSE RGB COMPOSITE COLOR
255
R
FF
255
G
FF
255
B
FF

Composite = 0
Dec RGB   = rgb(0,0,0)
Hex RGB   = #000000
Bin RGB   = 00000000 00000000 00000000

Inv Composite = 16777215
Inv Dec RGB   = rgb(255,255,255)
Inv Hex RGB   = #FFFFFF
Inv Bin RGB   = 11111111 11111111 11111111
         HTML/CSS/COMPOSITE/DECIMAL AND HEX RGB COLOR CODES
   ==============================================================

  COLOR_COMPONENT   DECIMAL   HEXADECIMAL
 -----------------  --------  -----------
  R = RED Level     0 to 255   00 to FF
  G = GREEN Level   0 to 255   00 to FF
  B = BLUE Level    0 to 255   00 to FF

  On an RGB monitor display, every color on the screen is made
  up of various combinations of intensity levels of red, green
  and blue (RGB).

  Each RGB level means the intensity or brightness level of the
  individual RGB colors, where each RGB color has 256 levels of
  brightness from 0 to 255, and can be combined to create over
  16 million total possible shades or colors.

  However, some shades are actually duplicates, so there are
  actually a few less distinct colors, but there are still
  many millions of unique colors in the palette.

  More precisely:

  Since there are 3 primary colors, Red, Green and Blue and 256
  possible intensity values for each RGB color:

  Let:
  p = 3   = Number of primary colors (R,G,B = 3 Colors)
  b = 8   = Number of binary bits per primary color
  N = 256 = Number of color intensity levels (0 = Min;  255 = Max)

  Each RGB composite value = R+G+B = 8+8+8 = 24 binary bits

  T = Total possible unique composite RGB color codes
    = (N ^ p)    =  256 ^ 3
    = (2 ^ p*b)  =  2^(3*8)  =  2 ^ 24
    =  16,777,216

  Maximum decimal value of binary integer = (2 ^ bits) − 1
  In the context of 8-bit RGB values:
  The maximum decimal value of RGB code = (2 ^ b) − 1
                                        = (2 ^ 8) − 1
                                        =  256 − 1
                                        =  255

  -------------------------------------------------------------
     Given the decimal (R,G,B) color levels, the corresponding
     composite color code (C) value can be computed by:

     C = R*65536 + G*256 + B

     The composite color (C) values range from 0 to 16777215.

     The composite color value  acts like a sequential serial
     number for each of the exactly  16,777,216 shades of the
     RGB spectrum, from 0 = Black to 16777215 = White and all
     the other 16,777,213 RGB shades in between.

 -------------------------------------------------------------
     Given the composite color code (C), the corresponding
     decimal (R,G,B) levels can be extracted by using the
     following algorithm, where:

     R = floor(C / 65536)
     B = C mod 256
     G = floor((C − R*65536 − B) / 256)

 -------------------------------------------------------------
        INVERSE or NEGATIVE RGB and COMPOSITE COLOR CODES

    >>> For the negative or inverse of a composite value (C),
        simply subtract the composite value from 16777215.

        Inv_C = 16777215 − C

    >>> To obtain the negative or inverse of an RGB color,
        simply subtract each of its RGB levels from 255.

        Inv_rgb(R,G,B) = rgb(255−R, 255−G, 255−B)