|
DAWorkbench 0.0.1
DAWorkbench API
|
颜色主题 更多...
#include <DAColorTheme.h>
Public 类型 | |
| enum | ColorThemeStyle { BuiltInStyle_Begin = 0 , Style_Matplotlib_Tab10 = BuiltInStyle_Begin , Style_Matplotlib_Seaborn , Style_Matlab_Modern , Style_R_Viridis , Style_Wong_Nature , Style_Archambault , Style_Cassatt1 , Style_Cassatt2 , Style_Demuth , Style_Derain , Style_Egypt , Style_Greek , Style_Hiroshige , Style_Hokusai2 , Style_Hokusai3 , Style_Ingres , Style_Isfahan1 , Style_Isfahan2 , Style_Java , Style_Johnson , Style_Kandinsky , Style_Morgenstern , Style_OKeeffe1 , Style_OKeeffe2 , Style_Pillement , Style_Tam , Style_Troy , Style_VanGogh3 , Style_Veronese , BuiltInStyle_End , Style_UserDefine = 2000 } |
| 已有的主题 更多... | |
| using | ColorList = QList< QColor > |
| using | container = DAGenericIndexedContainer< ColorList > |
| using | iterator = container::iterator |
| using | const_iterator = container::const_iterator |
Public 成员函数 | |
| DAColorTheme (ColorThemeStyle th) | |
| 不要用DAColorTheme mColorTheme { DAColorTheme::ColorTheme_Archambault }这样的初始化,会被当作std::initializer_list< QColor >捕获 | |
| DAColorTheme (const std::initializer_list< QColor > &v) | |
| DAColorTheme & | operator= (const ColorThemeStyle &th) |
| 重载等于操作符,可以直接通过主题赋值 | |
| QColor | next () |
| void | moveToNext () |
| QColor | operator++ () |
| QColor | operator++ (int) |
| QColor | previous () |
| void | moveToPrevious () |
| QColor | operator-- () |
| QColor | operator-- (int) |
| QColor | current () const |
| QColor | at (int index) const |
| QColor & | operator[] (int index) |
| const QColor & | operator[] (int index) const |
| ColorList | toColorList () const |
| QColor | lastColor () const |
| QColor | firstColor () const |
| bool | isFirstIndex () const |
| bool | isLastIndex () const |
| bool | isValidIndex () const |
| int | getCurrentIndex () const |
| void | setCurrentIndex (int v) |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| int | size () const |
| QColor | getColorAtPosition (float proportion) const |
| 按照比例获取颜色,颜色将使用插值获取,proportion必须为0~1之间 | |
| ColorThemeStyle | getColorThemeStyle () const |
| void | setColorThemeStyle (ColorThemeStyle style) |
| void | setUserDefineColorList (const ColorList &cls, ColorThemeStyle style=Style_UserDefine) |
静态 Public 成员函数 | |
| static DAColorTheme | create (ColorThemeStyle t) |
| 创建一个color theme | |
| static QColor | interpolateColor (const QColor &color1, const QColor &color2, float t) |
| 颜色插值,在颜色1和2之间的比例取值,t必须为0~1之间的数 | |
| static QString | colorThemeStyleName (ColorThemeStyle style) |
Protected 成员函数 | |
| container | createColorList (const ColorThemeStyle &th) |
颜色主题
| DA::DAColorTheme::DAColorTheme | ( | ColorThemeStyle | th | ) |
不要用DAColorTheme mColorTheme { DAColorTheme::ColorTheme_Archambault }这样的初始化,会被当作std::initializer_list< QColor >捕获
| th |
|
static |
创建一个color theme
| t |
| QColor DA::DAColorTheme::getColorAtPosition | ( | float | proportion | ) | const |
按照比例获取颜色,颜色将使用插值获取,proportion必须为0~1之间
| proportion | 占比,必须为0~1之间 |
|
static |
颜色插值,在颜色1和2之间的比例取值,t必须为0~1之间的数
| color1 | |
| color2 | |
| t | 插值占比,t必须为0~1之间的数 |
| DAColorTheme & DA::DAColorTheme::operator= | ( | const ColorThemeStyle & | th | ) |
重载等于操作符,可以直接通过主题赋值
| th |