27 #include "../../../se/Fill.h"
28 #include "../../../se/Utils.h"
29 #include "../utils/ColorPickerToolButton.h"
31 #include "ui_BasicFillWidgetForm.h"
38 m_ui(new
Ui::BasicFillWidgetForm),
39 m_fill(new
te::se::Fill)
48 QGridLayout* layout =
new QGridLayout(
m_ui->m_colorPickerFrame);
49 layout->setContentsMargins(0, 0, 0, 0);
50 layout->setSizeConstraint(QLayout::SetFixedSize);
76 m_fill = fill->
clone();
85 return m_fill->
clone();
90 return tr(
"Basic Fill");
105 m_color = QColor(rgba.
getRgba());
110 m_ui->m_fillOpacitySlider->setValue(m_color.alphaF() * 100);
115 m_colorPicker->setColor(m_color);
121 m_color.setRgb(color.red(), color.green(), color.blue(), m_color.alpha());
126 m_fill->setColor(m_color.name().toStdString());
132 double opacity = value / 100.0;
134 m_color.setAlpha(opacity * 255);
138 m_fill->setOpacity(QString::number(opacity,
'g', 2).toStdString());
void getRgba(int *r, int *g, int *b, int *a=0) const
It gets the color value.
TESEEXPORT void GetColor(const te::se::Stroke *stroke, te::color::RGBAColor &color)
It gets the RGBA color from the Stroke element.
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
const Graphic * getGraphicFill() const
Gets the GraphicFill element associate to this Fill.
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
A Fill specifies the pattern for filling an area geometry.
Fill * clone() const
It creates a new copy of this object.
#define TE_SE_DEFAULT_FILL_BASIC_COLOR
It specifies the default color used by basic fill (solid colors).
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.