QColor is a class in Qt Framework that represents a color in the RGB color space. It provides methods to manipulate and access color components such as red, green, blue, and alpha.
Example 1: This code creates a QColor object with red as the dominant color and sets the alpha component to 255 (opaque).
QColor color(Qt::red);
color.setAlpha(255);
Example 2: This code creates a QColor object with the RGB values set to 100, 150, and 200 and sets the alpha component to 120 (partially transparent).
QColor color(100, 150, 200, 120);
Example 3: This code creates a QColor object by parsing a string representation of a color in CSS format.
QColor color("#FFA500");
The QColor class is part of the Qt Core module.
C++ (Cpp) QColor::name - 30 examples found. These are the top rated real world C++ (Cpp) examples of QColor::name extracted from open source projects. You can rate examples to help us improve the quality of examples.