I've been using 3-digit Hex color values in CSS for a long time: #fff, #999, #069 etc., I can see how the repeating alphabets/numbers are merged to create a 3-digit hex color code, but I don't fully understand the pattern to be able to write a converter in PHP. Is there a documentation for this?
Edit: Oh, perhaps my question wasn't clear. I need to know how some of the 6 digit hex color values are converted to 3-digits? xxxxxx (ffffff) xxyyzz (006699), these are the only two patterns, correct?
I'd appreciate any help you can offer. Thanks!