Sanitized input to hexToRGB

CSS extractor broke in hexToRGB due to variable hex being undefined. I "fixed" this by returning an object encoding black if the input is null. This may lead to unexpected side effects, but the extractor is working again.