Define a function coloredPolygon to create a RegularPolygon of a particular color and number of sides. Use OptionsPattern in the definition to accept two options: color and sides. The first option will be used to specify the color of the polygon and the second option sides will be used to specify the number of sides. Use Options to set the default values for the two options. Set the default color to be Orange and default number of sides to be 3.
Here is my tentative code (with faults):
coloredPolygon := RegularPolygon [color, sides];
Options [coloredPolygon] {color ->Orange, sides->3}
coloredPolygon[]
Getting this error message:






rp[n_ : 3, col_ : Red] := Graphics[{EdgeForm[{col, Thick}], FaceForm[None], RegularPolygon[n]}]– ubpdqn Sep 12 '21 at 10:23