Add unit tests for validateBackgroundColor.

* Fix an issue with the length check that would allow any length string > 3 as
 long as all characters were correct.