diff --git a/forms/MainWindow.ui b/forms/MainWindow.ui
index 4408cc3a..66979b3e 100644
--- a/forms/MainWindow.ui
+++ b/forms/MainWindow.ui
@@ -18,7 +18,7 @@
- 850
+ 950
600
@@ -29,7 +29,7 @@
- Nheko
+ nheko
background-color: #f9f9f9
diff --git a/include/HistoryViewManager.h b/include/HistoryViewManager.h
index 9f07f064..99ab7384 100644
--- a/include/HistoryViewManager.h
+++ b/include/HistoryViewManager.h
@@ -43,7 +43,6 @@ public:
static QString chooseRandomColor();
static QString getUserColor(const QString &userid);
static QMap NICK_COLORS;
- static const QList COLORS;
public slots:
void setHistoryView(const RoomInfo &info);
diff --git a/src/HistoryViewManager.cc b/src/HistoryViewManager.cc
index a6cb3f6d..20a42f3b 100644
--- a/src/HistoryViewManager.cc
+++ b/src/HistoryViewManager.cc
@@ -126,38 +126,61 @@ void HistoryViewManager::setHistoryView(const RoomInfo &info)
QMap HistoryViewManager::NICK_COLORS;
-const QList HistoryViewManager::COLORS({"#FFF46E",
- "#A58BFF",
- "#50C9BA",
- "#9EE6CF",
- "#FFDD67",
- "#2980B9",
- "#FC993C",
- "#2772DB",
- "#CB8589",
- "#DDE8B9",
- "#55A44E",
- "#A9EEE6",
- "#53B759",
- "#9E3997",
- "#5D89D5",
- "#BB86B7",
- "#50a0cf",
- "#3C989F",
- "#5A4592",
- "#235e5b",
- "#d58247",
- "#e0a729",
- "#a2b636",
- "#4BBE2E"});
-
QString HistoryViewManager::chooseRandomColor()
{
std::random_device random_device;
std::mt19937 engine{random_device()};
- std::uniform_int_distribution dist(0, HistoryViewManager::COLORS.size() - 1);
+ std::uniform_real_distribution dist(0, 1);
- return HistoryViewManager::COLORS[dist(engine)];
+ float hue = dist(engine);
+ float saturation = 0.9;
+ float value = 0.7;
+
+ int hue_i = hue * 6;
+
+ float f = hue * 6 - hue_i;
+
+ float p = value * (1 - saturation);
+ float q = value * (1 - f * saturation);
+ float t = value * (1 - (1 - f) * saturation);
+
+ float r = 0;
+ float g = 0;
+ float b = 0;
+
+ if (hue_i == 0) {
+ r = value;
+ g = t;
+ b = p;
+ } else if (hue_i == 1) {
+ r = q;
+ g = value;
+ b = p;
+ } else if (hue_i == 2) {
+ r = p;
+ g = value;
+ b = t;
+ } else if (hue_i == 3) {
+ r = p;
+ g = q;
+ b = value;
+ } else if (hue_i == 4) {
+ r = t;
+ g = p;
+ b = value;
+ } else if (hue_i == 5) {
+ r = value;
+ g = p;
+ b = q;
+ }
+
+ int ri = r * 256;
+ int gi = g * 256;
+ int bi = b * 256;
+
+ QColor color(ri, gi, bi);
+
+ return color.name();
}
QString HistoryViewManager::getUserColor(const QString &userid)
diff --git a/src/LoginPage.cc b/src/LoginPage.cc
index 306b190a..f12bb8f8 100644
--- a/src/LoginPage.cc
+++ b/src/LoginPage.cc
@@ -84,8 +84,8 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent)
button_layout_->setContentsMargins(0, 0, 0, 50);
login_button_ = new RaisedButton("LOGIN", this);
- login_button_->setBackgroundColor(QColor("#acc7dc"));
- login_button_->setForegroundColor(QColor("black"));
+ login_button_->setBackgroundColor(QColor("#171919"));
+ login_button_->setForegroundColor(QColor("white"));
login_button_->setMinimumSize(350, 65);
login_button_->setCursor(QCursor(Qt::PointingHandCursor));
login_button_->setFontSize(17);
diff --git a/src/RegisterPage.cc b/src/RegisterPage.cc
index e9cdbcd7..2b2fae8b 100644
--- a/src/RegisterPage.cc
+++ b/src/RegisterPage.cc
@@ -99,8 +99,8 @@ RegisterPage::RegisterPage(QSharedPointer client, QWidget *parent)
error_label_->setStyleSheet("margin-bottom: 20px; color: #E22826; font-size: 11pt;");
register_button_ = new RaisedButton("REGISTER", this);
- register_button_->setBackgroundColor(QColor("#acc7dc"));
- register_button_->setForegroundColor(QColor("black"));
+ register_button_->setBackgroundColor(QColor("#171919"));
+ register_button_->setForegroundColor(QColor("white"));
register_button_->setMinimumSize(350, 65);
register_button_->setCursor(QCursor(Qt::PointingHandCursor));
register_button_->setFontSize(17);
diff --git a/src/WelcomePage.cc b/src/WelcomePage.cc
index 5f1fc1e1..37efbd14 100644
--- a/src/WelcomePage.cc
+++ b/src/WelcomePage.cc
@@ -59,16 +59,16 @@ WelcomePage::WelcomePage(QWidget *parent)
button_layout_->setContentsMargins(0, 20, 0, 80);
register_button_ = new RaisedButton("REGISTER", this);
- register_button_->setBackgroundColor(QColor("#acc7dc"));
- register_button_->setForegroundColor(QColor("#171919"));
+ register_button_->setBackgroundColor(QColor("#555459"));
+ register_button_->setForegroundColor(QColor("white"));
register_button_->setMinimumSize(240, 60);
register_button_->setCursor(QCursor(Qt::PointingHandCursor));
register_button_->setFontSize(14);
register_button_->setCornerRadius(3);
login_button_ = new RaisedButton("LOGIN", this);
- login_button_->setBackgroundColor(QColor("#acc7dc"));
- login_button_->setForegroundColor(QColor("#171919"));
+ login_button_->setBackgroundColor(QColor("#555459"));
+ login_button_->setForegroundColor(QColor("white"));
login_button_->setMinimumSize(240, 60);
login_button_->setCursor(QCursor(Qt::PointingHandCursor));
login_button_->setFontSize(14);