QColor color(255, 0, 0); // creates a red color
QColor color("#FF0000"); // also creates a red color
QColor color(255, 0, 0); int red = color.red(); // returns 255 color.setGreen(255); // changes the color to yellowThese examples demonstrate some basic functionality of the QColor class. The Qt library includes many other classes for handling colors, such as QBrush and QPen.