4 #include <QFontDatabase>
13 : m_frontColor(front),
22 QList<QColor> front, back;
27 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
28 front << QColor(250, 218, 131) << QColor(250, 218, 131) << QColor(250, 218, 131);
33 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
34 front << QColor(93, 177, 240) << QColor(93, 177, 240) << QColor(93, 177, 240);
39 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
40 front << QColor(139, 135, 150) << QColor(139, 135, 150) << QColor(139, 135, 150);
45 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
46 front << QColor(225, 125, 179) << QColor(225, 125, 179) << QColor(225, 125, 179);
51 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
52 front << QColor(157, 196, 0) << QColor(157, 196, 0) << QColor(157, 196, 0);
57 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
58 front << QColor(255, 42, 45) << QColor(255, 42, 45) << QColor(255, 42, 45);
63 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
64 front << QColor(138, 0, 226) << QColor(138, 0, 226) << QColor(138, 0, 226);
69 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
70 front << QColor(228, 157, 0) << QColor(228, 157, 0) << QColor(228, 157, 0);
75 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
76 front << QColor(23, 211, 190) << QColor(23, 211, 190) << QColor(23, 211, 190);
81 back << QColor(255, 255, 255) << QColor(255, 255, 255) << QColor(255, 255, 255);
82 front << QColor(255, 255, 0) << QColor(255, 255, 0) << QColor(255, 255, 0);
87 back << QColor(0, 52, 138) << QColor(0, 128, 192) << QColor(3, 202, 252);
88 front << QColor(130, 247, 253) << QColor(255, 255, 255) << QColor(3, 233, 252);
93 back << QColor(255, 172, 0) << QColor(255, 0, 0) << QColor(170, 0, 0);
94 front << QColor(255, 255, 164) << QColor(255, 255, 0) << QColor(255, 100, 26);
99 back << QColor(225, 225, 225) << QColor(106, 106, 106) << QColor(0, 0, 0);
100 front << QColor(255, 255, 255) << QColor(222, 222, 222) << QColor(128, 255, 255);
105 back << QColor(2, 166, 174) << QColor(128, 255, 255) << QColor(2, 166, 174);
106 front << QColor(255, 128, 0) << QColor(255, 255, 0) << QColor(255, 128, 0);
111 back << QColor(64, 0, 128) << QColor(255, 128, 255) << QColor(64, 0, 128);
112 front << QColor(255, 55, 146) << QColor(255, 243, 134) << QColor(255, 55, 146);
117 back << QColor(147, 255, 38) << QColor(70, 176, 0) << QColor(0, 85, 0);
118 front << QColor(255, 255, 255) << QColor(154, 255, 17) << QColor(255, 255, 0);
129 QList<QColor> colors;
131 for(
const QString &rgb :
qAsConst(rgbs))
133 const QStringList &var = rgb.split(
",");
138 colors << QColor(var[0].toInt(), var[1].toInt(), var[2].toInt());
146 for(
const QColor &rgb :
qAsConst(colors))
148 value.append(QString(
"%1,%2,%3;").arg(rgb.red()).arg(rgb.green()).arg(rgb.blue()));
157 m_lrcMaskWidthInterval(0),
158 m_intervalCount(0.0f),
205 const QStringList &family = QFontDatabase().families(QFontDatabase::Any);
206 if(!family.isEmpty())
208 if(index >= family.count())
212 m_font.setFamily(family[index]);
218 m_font.setBold(type == 1 || type == 3);
219 m_font.setItalic(type == 2 || type == 3);
224 QLinearGradient linearGradient;
226 for(
int i = 0; i < cl.count(); ++i)
230 linearGradient.setColorAt((i + 1) * 1.0 / cl.count(), rgb);
234 QLinearGradient maskLinearGradient;
236 for(
int i = 0; i < cl.count(); ++i)
240 maskLinearGradient.setColorAt((i + 1) * 1.0 / cl.count(), rgb);
290 m_font.setPointSize(size);
307 QLabel::setText(str);
#define QtSkipEmptyParts
String skip empty parts.
The class of the lrc color.
MusicLrcManager(QWidget *parent=nullptr)
void setFontFamily(int index)
static constexpr int LRC_PER_TIME
float m_lrcMaskWidthInterval
QString writeColorConfig(const QList< QColor > &colors)
QList< QColor > m_backColor
QLinearGradient m_maskLinearGradient
void setLrcFontSize(int size)
void setFontType(int type)
void setText(const QString &str)
void startDrawLrcMask(qint64 intervaltime)
void setSelfPosition(int x, int y)
MusicLrcColor mapIndexToColor(MusicLrcColor::Color index)
QList< QColor > m_frontColor
void setLinearGradientColor(const MusicLrcColor &color)
QLinearGradient m_linearGradient
QList< QColor > readColorConfig(const QString &value)