Skip to content

Commit

Permalink
fix(ui/webview_helpers): append 0 if color channel value is 1 char long
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetTechuila authored and john-preston committed Oct 19, 2024
1 parent 754d467 commit b363d8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Telegram/SourceFiles/ui/webview_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace {
[[nodiscard]] QByteArray Serialize(const QColor &qt) {
if (qt.alpha() == 255) {
return '#'
+ QByteArray::number(qt.red(), 16).right(2)
+ QByteArray::number(qt.green(), 16).right(2)
+ QByteArray::number(qt.blue(), 16).right(2);
+ QByteArray::number(qt.red(), 16).rightJustified(2, '0')
+ QByteArray::number(qt.green(), 16).rightJustified(2, '0')
+ QByteArray::number(qt.blue(), 16).rightJustified(2, '0');
}
return "rgba("
+ QByteArray::number(qt.red()) + ","
Expand Down

0 comments on commit b363d8b

Please sign in to comment.