int red = myColor.red(); int green = myColor.green(); int blue = myColor.blue();
#includeThis code creates a new QColor object representing the RGB color (72, 118, 255). The getRgb function is then called to retrieve the red, green, and blue components of the color, which are stored in the variables red, green, and blue. Finally, the values are printed to the console. The QColor class is part of the Qt Core and Qt GUI libraries, which are included in the Qt application development framework.#include int main() { QColor myColor(72, 118, 255); int red, green, blue; myColor.getRgb(&red, &green, &blue); std::cout << "Red: " << red << std::endl; std::cout << "Green: " << green << std::endl; std::cout << "Blue: " << blue << std::endl; return 0; }