Small colour correction

This commit is contained in:
Luke D. Jones
2024-03-06 22:41:55 +13:00
parent fa2255cbaf
commit efcad3f6f9
3 changed files with 52 additions and 53 deletions

View File

@@ -6,7 +6,7 @@ use rog_dbus::zbus_anime::AnimeProxy;
use rog_dbus::zbus_aura::AuraProxy; use rog_dbus::zbus_aura::AuraProxy;
use rog_dbus::zbus_platform::{PlatformProxy, PlatformProxyBlocking}; use rog_dbus::zbus_platform::{PlatformProxy, PlatformProxyBlocking};
use rog_platform::platform::Properties; use rog_platform::platform::Properties;
use slint::{ ComponentHandle, Model, RgbaColor, SharedString, Weak}; use slint::{ComponentHandle, Model, RgbaColor, SharedString, Weak};
use zbus::proxy::CacheProperties; use zbus::proxy::CacheProperties;
use crate::config::Config; use crate::config::Config;
@@ -405,7 +405,7 @@ fn decode_hex(s: &str) -> RgbaColor<u8> {
red: *c.first().unwrap_or(&255), red: *c.first().unwrap_or(&255),
green: *c.get(1).unwrap_or(&128), green: *c.get(1).unwrap_or(&128),
blue: *c.get(2).unwrap_or(&32), blue: *c.get(2).unwrap_or(&32),
.. Default::default() ..Default::default()
} }
} }
@@ -495,8 +495,7 @@ fn setup_aura_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
handle handle
.global::<AuraPageData>() .global::<AuraPageData>()
.invoke_update_led_mode_data(out.into()); .invoke_update_led_mode_data(out.into());
handle handle.invoke_external_colour_change();
.invoke_external_colour_change();
}) })
.ok(); .ok();
} }

View File

@@ -2,7 +2,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-03-04 00:28+0000\n" "POT-Creation-Date: 2024-03-06 09:35+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -12,41 +12,6 @@ msgstr ""
"Language: \n" "Language: \n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
#: rog-control-center/ui/main_window.slint:38
msgctxt "MainWindow"
msgid "ROG"
msgstr ""
#: rog-control-center/ui/main_window.slint:40
msgctxt "Menu1"
msgid "System Control"
msgstr ""
#: rog-control-center/ui/main_window.slint:41
msgctxt "Menu2"
msgid "Keyboard Aura"
msgstr ""
#: rog-control-center/ui/main_window.slint:42
msgctxt "Menu3"
msgid "AniMe Matrix"
msgstr ""
#: rog-control-center/ui/main_window.slint:43
msgctxt "Menu4"
msgid "Fan Curves"
msgstr ""
#: rog-control-center/ui/main_window.slint:44
msgctxt "Menu5"
msgid "App Settings"
msgstr ""
#: rog-control-center/ui/main_window.slint:45
msgctxt "Menu6"
msgid "About"
msgstr ""
#: rog-control-center/ui/pages/anime.slint:7 #: rog-control-center/ui/pages/anime.slint:7
msgctxt "Anime Brightness" msgctxt "Anime Brightness"
msgid "Off" msgid "Off"
@@ -352,42 +317,42 @@ msgctxt "Aura speed"
msgid "High" msgid "High"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:121 #: rog-control-center/ui/pages/aura.slint:128
msgctxt "PageAura" msgctxt "PageAura"
msgid "Brightness" msgid "Brightness"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:132 #: rog-control-center/ui/pages/aura.slint:139
msgctxt "PageAura" msgctxt "PageAura"
msgid "Aura mode" msgid "Aura mode"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:149 #: rog-control-center/ui/pages/aura.slint:156
msgctxt "PageAura" msgctxt "PageAura"
msgid "Colour 1" msgid "Colour 1"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:186 #: rog-control-center/ui/pages/aura.slint:177
msgctxt "PageAura" msgctxt "PageAura"
msgid "Colour 2" msgid "Colour 2"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:226 #: rog-control-center/ui/pages/aura.slint:204
msgctxt "PageAura" msgctxt "PageAura"
msgid "Zone" msgid "Zone"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:246 #: rog-control-center/ui/pages/aura.slint:224
msgctxt "PageAura" msgctxt "PageAura"
msgid "Direction" msgid "Direction"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:266 #: rog-control-center/ui/pages/aura.slint:244
msgctxt "PageAura" msgctxt "PageAura"
msgid "Speed" msgid "Speed"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:284 #: rog-control-center/ui/pages/aura.slint:262
msgctxt "PageAura" msgctxt "PageAura"
msgid "Apply" msgid "Apply"
msgstr "" msgstr ""
@@ -537,3 +502,38 @@ msgctxt "PageSystem"
msgid "Throttle Policy on AC" msgid "Throttle Policy on AC"
msgstr "" msgstr ""
#: rog-control-center/ui/main_window.slint:43
msgctxt "MainWindow"
msgid "ROG"
msgstr ""
#: rog-control-center/ui/main_window.slint:45
msgctxt "Menu1"
msgid "System Control"
msgstr ""
#: rog-control-center/ui/main_window.slint:46
msgctxt "Menu2"
msgid "Keyboard Aura"
msgstr ""
#: rog-control-center/ui/main_window.slint:47
msgctxt "Menu3"
msgid "AniMe Matrix"
msgstr ""
#: rog-control-center/ui/main_window.slint:48
msgctxt "Menu4"
msgid "Fan Curves"
msgstr ""
#: rog-control-center/ui/main_window.slint:49
msgctxt "Menu5"
msgid "App Settings"
msgstr ""
#: rog-control-center/ui/main_window.slint:50
msgctxt "Menu6"
msgid "About"
msgstr ""

View File

@@ -25,7 +25,7 @@ export component ColourSlider inherits VerticalLayout {
Colors.rgb( 127, 0, 255), Colors.rgb( 127, 0, 255),
Colors.rgb( 255, 0, 255), Colors.rgb( 255, 0, 255),
Colors.rgb( 255, 0, 127), Colors.rgb( 255, 0, 127),
// Colors.rgb( 128, 128, 128) Colors.rgb( 128, 128, 128)
]; ];
property <[color]> base_shade: [ property <[color]> base_shade: [
blend_lightness(base_colour, 1.0), blend_lightness(base_colour, 1.0),
@@ -53,9 +53,9 @@ export component ColourSlider inherits VerticalLayout {
callback external_colour_change(); callback external_colour_change();
external_colour_change => { external_colour_change => {
if (root.final_colour.hue() < 0) { if (root.final_colour.hue() < 0) {
c1.value = (root.base_colours.length) * ((root.final_colour.hue() + 360) / 360); c1.value = (root.base_colours.length - 1) * ((root.final_colour.hue() + 360) / 360);
} else { } else {
c1.value = (root.base_colours.length) * (root.final_colour.hue() / 360); c1.value = (root.base_colours.length - 1) * (root.final_colour.hue() / 360);
} }
c2.value = root.base_shade.length - (root.base_shade.length * root.final_colour.brightness()); c2.value = root.base_shade.length - (root.base_shade.length * root.final_colour.brightness());
root.set_base_colour(); root.set_base_colour();
@@ -64,14 +64,14 @@ export component ColourSlider inherits VerticalLayout {
Rectangle { Rectangle {
height: 32px; height: 32px;
// 13 colours // 13 colours
background: @linear-gradient(90deg, base_colours[0], base_colours[1], base_colours[2], base_colours[3], base_colours[4], base_colours[5], base_colours[6], base_colours[7], base_colours[8], base_colours[9], base_colours[10], base_colours[11]); //, base_colours[12]); background: @linear-gradient(90deg, base_colours[0], base_colours[1], base_colours[2], base_colours[3], base_colours[4], base_colours[5], base_colours[6], base_colours[7], base_colours[8], base_colours[9], base_colours[10], base_colours[11], base_colours[12]);
clip: true; clip: true;
border-radius: 6px; border-radius: 6px;
c1 := Slider { c1 := Slider {
width: parent.width; width: parent.width;
height: parent.height; height: parent.height;
minimum: 0; minimum: 0;
maximum: 12; maximum: root.base_colours.length - 1; // One less than the array length
changed => { changed => {
set_base_colour(); set_base_colour();
hex = set_hex_from_colour(final_colour); hex = set_hex_from_colour(final_colour);