ensure that colors are valid in RGB and improve example interface