Qt color define

本文介绍了Qt中预定义的颜色及其使用方式,包括20种由Qt::GlobalColor枚举描述的颜色,如黑色、白色及不同深浅的灰色等。此外还详细解释了Qt::color0、Qt::color1和Qt::transparent三种颜色的特殊用途。

Predefined Colors

There are 20 predefined QColors described by the  Qt::GlobalColor  enum, including black, white, primary and secondary colors, darker versions of these colors and three shades of gray. QColor also recognizes a variety of color names; the static  colorNames () function returns a  QStringList  color names that QColor knows about.

Additionally, the Qt::color0Qt::color1 and Qt::transparent colors are used for special purposes.

Qt::color0 (zero pixel value) and Qt::color1 (non-zero pixel value) are special colors for drawing in QBitmaps. Painting with Qt::color0 sets the bitmap bits to 0 (transparent; i.e., background), and painting with Qt::color1 sets the bits to 1 (opaque; i.e., foreground).

Qt::transparent is used to indicate a transparent pixel. When painting with this value, a pixel value will be used that is appropriate for the underlying pixel format in use.

QColor::QColor ( int rint gint bint a = 255 )

Constructs a color with the RGB value rgb, and the alpha-channel (transparency) value of a.

The color is left invalid if any of the arguments are invalid.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值