Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Object Oriented Programming Create a class called Colour. It will use rgb values that will default to 0 , 0 , 0 . Besides the
Object Oriented Programming
Create a class called Colour.
It will use rgb values that will default to
Besides the constructor, write the following methods:
repr
should allow the colour to be printed like this Colour
modred which takes a factor to add to value
this factor may be positive or negative and will be added to the value
make sure that this takes into account that value must be in the range
override the addition operator
takes another colour make sure of that it is a colour and adds the values of the two colours
make sure that this takes into account that values must be in the range
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started