Move the existing logic to a single method.
Use the color if it was provided, otherwise use the old logic.
Force an integer check.
Finally get version 1.0.