Hi,
You could create a 'class' or 'type' RGB which has public members r, g and b. It would have a method setRGB() to set these three members, and also the other member functions you mention.
The A and C classes would have a member of type RGB, say m_rgb. If a method in this class would need to know anything about the color, it would use the members m_rgb.r, m_rgb.g and m_rgb.b.
This way you don't have to implement anything in your base classes, or in any other class in which you would like to use a color.
Best regards,
Marc
Bookmarks