Is there a mathematical conversion from RGB to HTML color code?
HTML color codes are RGB values expressed in hexadecimal notation (00-FF, which is equivalent to 0-255). For example, black (0,0,0) converts to 000000, white (255,255,255) converts to FFFFFF, and a full blue (0,0,255) converts to 0000FF. A web search will turn up plenty of conversion utilities. One example is easycalculation.com.