-------------------------------------------------- HTML COLORS -------------------------------------------------- 147 named colors, but not all colors have names. We use 24-bit color in HTML 2^24 = 16,777,216 unique colors 1 byte = 8 bits (values between 0 and 255) 3 bytes = 24 bits 1 byte for red 1 byte for green 1 byte for blue 256 x 256 x 256 = 16,777,216 colors -------------------------------------------------- Byte values are expressed in base 16 (hexadecimal) Hex Digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F To convert decimal to hex: Divide the number by 16, extract both the quotient and the remainder. The remainder is the right digit, the quotient is the left (values between 0...15). Any values greater than 9 use the corresponding letter from the list of digits (e.g., 10=A). -------------------------------------------------- Want: Red=251, Green=29, Blue=137 Red: 251/16=15R11 FB (lots) Green: 29/16= 1R13 1D (little) Blue: 137/16= 8R9 89 (mid range) The HTML color: #FB1D89 (reddish-purple) -------------------------------------------------- 0 = 00 (off) 128 = 80 (mid) 255 = FF (full power) Look at dominant (leftmost) digit of each pair to see whether that primary is low, medium, or high. For example, In #FB1D89, the dominant digit of red (FB) is F, which is very high. In the green (1D) the dominant digit is 1, very low. In the blue (89) the dominant digit is 8, or mid-range. -------------------------------------------------- #000000 = Black #FF0000 = Red #FF00FF = Magenta, Fuchsia #FFFF00 = Yellow #00FFFF = Cyan, Aqua #FFFFFF = White #808080 = Gray, Grey #C0C0C0 = Silver (a light gray) #404040 = no name (a dark gray)