Skip to content

Commit 4a86916

Browse files
committed
Use Color::White to replace Color(0xFFFFFF)
1 parent 3911c05 commit 4a86916

49 files changed

Lines changed: 253 additions & 253 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Applications/BrightnessControl/BrightnessControl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace MatrixOS::LED
1111

1212
void BrightnessControl::Start() {
1313
name = "Brightness Control";
14-
nameColor = Color(0xFFFFFF);
14+
nameColor = Color::White;
1515

1616

1717
// Brightness Control
@@ -36,7 +36,7 @@ void BrightnessControl::Start() {
3636
brightnessSelector.SetDimension(brightnessSelectorDimension);
3737
brightnessSelector.SetCount(map_length);
3838
brightnessSelector.SetLitMode(UISelectorLitMode::LIT_ALWAYS);
39-
brightnessSelector.SetIndividualColorFunc([&](uint16_t index) -> Color { return (map[index] > threshold ? Color(0xFF0000) : Color(0xFFFFFF)).DimIfNot(map[index] <= MatrixOS::UserVar::brightness.value); });
39+
brightnessSelector.SetIndividualColorFunc([&](uint16_t index) -> Color { return (map[index] > threshold ? Color(0xFF0000) : Color::White).DimIfNot(map[index] <= MatrixOS::UserVar::brightness.value); });
4040
brightnessSelector.OnChange([&](uint8_t value) -> void {
4141
uint8_t brightness = map[value];
4242
MatrixOS::LED::SetBrightness(brightness);
@@ -47,7 +47,7 @@ void BrightnessControl::Start() {
4747
// Number Display
4848
UI4pxNumber brightnessDisplay;
4949
brightnessDisplay.SetName("Brightness");
50-
brightnessDisplay.SetColorFunc([&](uint16_t digit) -> Color { return digit % 2 ? Color(0xFFFFFF) : (MatrixOS::UserVar::brightness.value > threshold) ? Color(0xFF0000) : GLOBAL_BRIGHTNESS_COLOR; });
50+
brightnessDisplay.SetColorFunc([&](uint16_t digit) -> Color { return digit % 2 ? Color::White : (MatrixOS::UserVar::brightness.value > threshold) ? Color(0xFF0000) : GLOBAL_BRIGHTNESS_COLOR; });
5151
brightnessDisplay.SetDigits(3);
5252
brightnessDisplay.SetValuePointer((int32_t*)&displayValue);
5353
AddUIComponent(brightnessDisplay, origin + Point(-4, -3));

Applications/BrightnessControl/UI4pxFloat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class UI4pxFloat : public UIComponent {
1515
this->name = "";
1616
this->color = Color(0);
1717
this->value = nullptr;
18-
this->alternativeColor = Color(0xFFFFFF);
18+
this->alternativeColor = Color::White;
1919
}
2020

2121
virtual Dimension GetSize() { return Dimension(8, 4); }

Applications/Companion/Companion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void Companion::ActionMenu() {
9797

9898
UIButton systemSettingBtn;
9999
systemSettingBtn.SetName("System Setting");
100-
systemSettingBtn.SetColor(Color(0xFFFFFF));
100+
systemSettingBtn.SetColor(Color::White);
101101
systemSettingBtn.OnPress([&]() -> void { MatrixOS::SYS::OpenSetting(); });
102102
actionMenu.AddUIComponent(systemSettingBtn, Point(7, 7));
103103

Applications/CustomControlMap/CustomControlMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ void CustomControlMap::ActionMenu() {
392392

393393
UIButton systemSettingBtn;
394394
systemSettingBtn.SetName("System Setting");
395-
systemSettingBtn.SetColor(Color(0xFFFFFF));
395+
systemSettingBtn.SetColor(Color::White);
396396
systemSettingBtn.OnPress([&]() -> void { MatrixOS::SYS::OpenSetting(); });
397397
actionMenu.AddUIComponent(systemSettingBtn, Point(7, 5));
398398

Applications/Dice/Dice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class Dice : public Application {
4141
CreateSavedVar("Dice", mode, DiceMode, Dot);
4242

4343
// Dot Mode
44-
CreateSavedVar("Dice", rolling_color, Color, Color(0xFFFFFF));
45-
CreateSavedVar("Dice", confirmed_color, Color, Color(0xFFFFFF));
44+
CreateSavedVar("Dice", rolling_color, Color, Color::White);
45+
CreateSavedVar("Dice", confirmed_color, Color, Color::White);
4646
CreateSavedVar("Dice", dot_faces, uint8_t, 6);
4747
CreateSavedVar("Dice", rolling_speed, uint8_t, 30);
4848
CreateSavedVar("Dice", flashing_speed, uint8_t, 10);

Applications/Example/Example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void ExampleAPP::UIMenu() {
120120
// A large button that cycles though the brightness of the device
121121
UIButton brightnessBtn;
122122
brightnessBtn.SetName("Brightness"); // Name
123-
brightnessBtn.SetColor(Color(0xFFFFFF)); // Color
123+
brightnessBtn.SetColor(Color::White); // Color
124124
brightnessBtn.SetSize(Dimension(2, 2)); // Size of the button
125125
brightnessBtn.OnPress([&]() -> void { MatrixOS::LED::NextBrightness(); }); // Function to call when the button is pressed
126126
brightnessBtn.OnHold([&]() -> void {BrightnessControl().Start(); }); // Function to call when the button is hold down

Applications/Example/Example.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ExampleAPP : public Application {
2323
inline static Application_Info info = {
2424
.name = "Example",
2525
.author = "203 Systems",
26-
.color = Color(0xFFFFFF),
26+
.color = Color::White,
2727
.version = 1,
2828
.visibility = true,
2929
};
@@ -42,10 +42,10 @@ class ExampleAPP : public Application {
4242

4343
#ifndef EXAMPLEAPP_SAVED_VAR
4444
uint8_t number = 0;
45-
Color color = Color(0xFFFFFF);
45+
Color color = Color::White;
4646
#else
4747
CreateSavedVar("Example", number, uint8_t, 0);
48-
CreateSavedVar("Example", color, Color, Color(0xFFFFFF));
48+
CreateSavedVar("Example", color, Color, Color::White);
4949

5050
// Namespace (This namespace only applies to this application. So even if two different applications have the same variable name, they won't conflict), variable name (no ""), variable type, default value
5151
// And then just use the variable as a normal variable. The value will be saved & loaded automatically!

Applications/Gamepad/Gamepad.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "UIGamepadAxis.h"
66

77
void Gamepad::Setup(const vector<string>& args) {
8-
UI gamepadUI("", Color(0xFFFFFF));
8+
UI gamepadUI("", Color::White);
99

1010
UIKeyboardKey Skey(Color(0xFF0000), KEY_S);
1111
gamepadUI.AddUIComponent(Skey, Point(0, 1));
@@ -80,7 +80,7 @@ void Gamepad::ActionMenu() {
8080

8181
UIButton systemSettingBtn;
8282
systemSettingBtn.SetName("System Setting");
83-
systemSettingBtn.SetColor(Color(0xFFFFFF));
83+
systemSettingBtn.SetColor(Color::White);
8484
systemSettingBtn.OnPress([&]() -> void { MatrixOS::SYS::OpenSetting(); });
8585
actionMenu.AddUIComponent(systemSettingBtn, Point(7, 7));
8686

Applications/Gamepad/UIDPad.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class UIDPad : public UIComponent {
8585
{
8686
for(int y = 0; y < 3; y++)
8787
{
88-
MatrixOS::LED::SetColor(origin + Point(x,y), Point(x,y) == DirectionToPoint(lastDirection) ? Color(0xFFFFFF) : GetColor());
88+
MatrixOS::LED::SetColor(origin + Point(x,y), Point(x,y) == DirectionToPoint(lastDirection) ? Color::White : GetColor());
8989
}
9090
}
9191
return true;

Applications/Gamepad/UIGamepadAxis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class UIGamepadAxis : public UIComponent {
2929
virtual bool Render(Point origin) {
3030
if (value)
3131
{
32-
MatrixOS::LED::SetColor(origin, Color(0xFFFFFF).Scale(value.to8bits()));
32+
MatrixOS::LED::SetColor(origin, Color::White.Scale(value.to8bits()));
3333
}
3434
else
3535
{

0 commit comments

Comments
 (0)