summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorΣτέφανος <sofr.stef@cytanet.com.cy>2022-10-04 11:47:26 +0300
committerΣτέφανος <sofr.stef@cytanet.com.cy>2022-10-04 11:47:26 +0300
commit2f1bf0df013ecc831598eed7aa46bf962065b1eb (patch)
treea88874256eccf221dca487aba0ed0855d0870e9c /src
parentc3bdd5d02f87b8531261dad0cf299fc18e51ee73 (diff)
No need for const & in bool
Diffstat (limited to 'src')
-rw-r--r--src/btop_theme.cpp8
-rw-r--r--src/btop_theme.hpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/btop_theme.cpp b/src/btop_theme.cpp
index 4a73002..52fe6e1 100644
--- a/src/btop_theme.cpp
+++ b/src/btop_theme.cpp
@@ -157,7 +157,7 @@ namespace Theme {
}
}
- string hex_to_color(string hexa, const bool& t_to_256, const string& depth) {
+ string hex_to_color(string hexa, bool t_to_256, const string& depth) {
if (hexa.size() > 1) {
hexa.erase(0, 1);
for (auto& c : hexa) {
@@ -196,7 +196,7 @@ namespace Theme {
return "";
}
- string dec_to_color(int r, int g, int b, const bool& t_to_256, const string& depth) {
+ string dec_to_color(int r, int g, int b, bool t_to_256, const string& depth) {
string pre = Fx::e + (depth == "fg" ? "38" : "48") + ";" + (t_to_256 ? "5;" : "2;");
r = std::clamp(r, 0, 255);
g = std::clamp(g, 0, 255);
@@ -234,7 +234,7 @@ namespace Theme {
void generateColors(const unordered_flat_map<string, string>& source) {
vector<string> t_rgb;
string depth;
- const bool& t_to_256 = Config::getB("lowcolor");
+ bool t_to_256 = Config::getB("lowcolor");
colors.clear(); rgbs.clear();
for (const auto& [name, color] : Default_theme) {
if (name == "main_bg" and not Config::getB("theme_background")) {
@@ -297,7 +297,7 @@ namespace Theme {
//* Generate color gradients from two or three colors, 101 values indexed 0-100
void generateGradients() {
gradients.clear();
- const bool& t_to_256 = Config::getB("lowcolor");
+ bool t_to_256 = Config::getB("lowcolor");
//? Insert values for processes greyscale gradient and processes color gradient
rgbs.insert({
diff --git a/src/btop_theme.hpp b/src/btop_theme.hpp
index 27c102b..65687ff 100644
--- a/src/btop_theme.hpp
+++ b/src/btop_theme.hpp
@@ -40,13 +40,13 @@ namespace Theme {
//* Args hexa: ["#000000"-"#ffffff"] for color, ["#00"-"#ff"] for greyscale
//* t_to_256: [true|false] convert 24bit value to 256 color value
//* depth: ["fg"|"bg"] for either a foreground color or a background color
- string hex_to_color(string hexa, const bool& t_to_256=false, const string& depth="fg");
+ string hex_to_color(string hexa, bool t_to_256=false, const string& depth="fg");
//* Generate escape sequence for 24-bit or 256 color and return as a string
//* Args r: [0-255], g: [0-255], b: [0-255]
//* t_to_256: [true|false] convert 24bit value to 256 color value
//* depth: ["fg"|"bg"] for either a foreground color or a background color
- string dec_to_color(int r, int g, int b, const bool& t_to_256=false, const string& depth="fg");
+ string dec_to_color(int r, int g, int b, bool t_to_256=false, const string& depth="fg");
//* Update list of paths for available themes
void updateThemes();