14 #include <QColorDialog>
27 : QDialog(parent, Qt::Tool),
Ui::ColorGradientDialog() {
30 connect(firstColorButton, &QAbstractButton::clicked,
this,
32 connect(secondColorButton, &QAbstractButton::clicked,
this,
51 defaultRampRadioButton->setChecked(
true);
54 customRampRadioButton->setChecked(
true);
57 bandingRadioButton->setChecked(
true);
67 if (customRampRadioButton->isChecked())
69 else if (bandingRadioButton->isChecked())
78 assert(customRampRadioButton->isChecked());
91 QColor newCol = QColorDialog::getColor(
s_firstColor,
this);
92 if (newCol.isValid()) {
100 if (newCol.isValid()) {
double getBandingFrequency() const
Returns the frequency of the gradient ('Banding' mode)
GradientType
Gradient types.
void getColors(QColor &first, QColor &second) const
Returns the two colors of the gradient ('TwoColors' mode)
ccColorGradientDlg(QWidget *parent)
Default constructor.
unsigned char getDimension() const
Returns the ramp dimension.
void setType(GradientType type)
Sets the currently activated type.
GradientType getType() const
Returns selected gradient type.
static void SetButtonColor(QAbstractButton *button, const QColor &col)
Sets a button background color.
static ccColorGradientDlg::GradientType s_lastType(ccColorGradientDlg::Default)
static int s_lastDimIndex
static QColor s_firstColor(Qt::black)
static QColor s_secondColor(Qt::white)
constexpr Rgb black(0, 0, 0)
constexpr Rgb white(MAX, MAX, MAX)