|
QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
|
Provides cyclic color selection from predefined palettes. 更多...
#include <qwt_color_cycle.h>
Public 类型 | |
| enum | Palette { Default10 , Tab10 , Tab20 , Set1 , Set2 , Set3 , OkabeIto } |
| Built-in color palettes 更多... | |
Public 成员函数 | |
| QwtColorCycle () | |
| Construct with the Default10 palette (matplotlib classic) | |
| QwtColorCycle (Palette palette) | |
| Construct with a built-in palette | |
| QwtColorCycle (const QVector< QColor > &colors) | |
| Construct with custom colors | |
| QColor | color (int index) const |
| Get a color by index (wraps around) | |
| int | count () const |
| Get the number of colors in the cycle | |
| void | setPalette (Palette) |
| Set the palette from a built-in preset | |
| void | setColors (const QVector< QColor > &) |
| Set custom colors | |
| QVector< QColor > | colors () const |
| Get the current color list | |
静态 Public 成员函数 | |
| static QVector< QColor > | paletteColors (Palette) |
| Get the colors for a built-in palette | |
Provides cyclic color selection from predefined palettes.
QwtColorCycle manages an ordered list of colors and returns them in a cyclic manner using the color() method. This is used by QwtPlot to automatically assign distinct colors to plot items (curves, bar charts, etc.) when they are attached without a user-specified pen or brush.
Several built-in palettes are available, inspired by matplotlib, Tableau, ColorBrewer, and the Okabe-Ito colorblind-safe palette.
Built-in color palettes
|
explicit |
Construct with a built-in palette
| palette | Built-in palette selector |
|
explicit |
Construct with custom colors
| colors | Custom color list |
| QColor QwtColorCycle::color | ( | int | index | ) | const |
Get a color by index (wraps around)
Get a color by index with cyclic wrap-around
| index | Zero-based index (negative values are handled) |
| QVector< QColor > QwtColorCycle::colors | ( | ) | const |
Get the current color list
| int QwtColorCycle::count | ( | ) | const |
Get the number of colors in the cycle
Get the colors for a built-in palette
Get the color list for a built-in palette
| palette | Built-in palette selector |
| void QwtColorCycle::setColors | ( | const QVector< QColor > & | colors | ) |
Set custom colors
Replace current colors with a custom list
| colors | Custom color list |
| void QwtColorCycle::setPalette | ( | Palette | palette | ) |
Set the palette from a built-in preset
Replace current colors with a built-in palette
| palette | Built-in palette selector |