Skip to content

Quick-tip 26 | Check if a string is a valid color

Quick-tip 26 demonstrates a show-me study that draws squares of various colors on a chart, determined by user inputs. The quick-tip demonstrates what happens if one of the strings input by a user is not a valid color.

The quick tip then shows a way of dealing with this eventuality by printing a message and then substituting a default color.

Gold Pass members may copy and paste the code below. Make sure that you are logged in with your Gold Pass details.

Video

Gold Pass content

This content is for members only.