Consider case where user cancels color selection dialog
In case the user, when asked to select a color, cancels the dialog
provided by QColor::getColor(..), the returned color is an
invalid QColor object. Only make use the returned color if it is valid.