Provide a data definition for a general class of shapes. The class should at least subsume the classes of colored circles and rectangles from section…