|  | Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions |

# Qt 3 Support Members for QColor

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

- QColor class reference

### Public Functions

- QColor ( int x, int y, int z, Spec colorSpec )
- void getRgba ( int * r, int * g, int * b, int * a ) const
- void hsv ( int * h, int * s, int * v ) const
- uint pixel ( int screen = -1 ) const
- void rgb ( int * r, int * g, int * b ) const
- void setRgba ( int r, int g, int b, int a )

## Member Function Documentation

### QColor::QColor ( int x, int y, int z, Spec colorSpec )

Use one of the other QColor constructors, or one of the static convenience functions, instead.

### void QColor::getRgba ( int * r, int * g, int * b, int * a ) const

Populates r, g, and b with the color's RGB values. a is populated with the color's alpha channel (opacity) value. All the values are in the range 0 to 255.

See also setRgba(), setRgb(), and setHsv().

### void QColor::hsv ( int * h, int * s, int * v ) const

Use getHsv() instead.

### uint QColor::pixel ( int screen = -1 ) const

Returns the pixel value.

This value is used by the underlying window system to refer to a color. It can be thought of as an index into the display hardware's color table, but the value is an arbitrary 32-bit value.

The screen parameter is only used under X11 to specify the X11 screen.

### void QColor::rgb ( int * r, int * g, int * b ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use getRgb() instead.

### void QColor::setRgba ( int r, int g, int b, int a )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Sets the RGBA value to r, g, b, a. The arguments, r, g, b, and a must all be in the range 0 to 255. If any of them are outside the legal range, the color is not changed.

See also getRgba(), setRgb(), and setHsv().