properly handle 3 digit hex codes, fixes #1