Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
