mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix(ui/webview_helpers): append 0 if color channel value is 1 char long
This commit is contained in:
parent
754d467440
commit
b363d8bfb5
1 changed files with 3 additions and 3 deletions
|
@ -15,9 +15,9 @@ namespace {
|
||||||
[[nodiscard]] QByteArray Serialize(const QColor &qt) {
|
[[nodiscard]] QByteArray Serialize(const QColor &qt) {
|
||||||
if (qt.alpha() == 255) {
|
if (qt.alpha() == 255) {
|
||||||
return '#'
|
return '#'
|
||||||
+ QByteArray::number(qt.red(), 16).right(2)
|
+ QByteArray::number(qt.red(), 16).rightJustified(2, '0')
|
||||||
+ QByteArray::number(qt.green(), 16).right(2)
|
+ QByteArray::number(qt.green(), 16).rightJustified(2, '0')
|
||||||
+ QByteArray::number(qt.blue(), 16).right(2);
|
+ QByteArray::number(qt.blue(), 16).rightJustified(2, '0');
|
||||||
}
|
}
|
||||||
return "rgba("
|
return "rgba("
|
||||||
+ QByteArray::number(qt.red()) + ","
|
+ QByteArray::number(qt.red()) + ","
|
||||||
|
|
Loading…
Add table
Reference in a new issue