Skip to content

Commit

Permalink
added random color print statement; added GL73 to supported devices
Browse files Browse the repository at this point in the history
  • Loading branch information
bwu62 committed May 13, 2020
1 parent 45dad44 commit b1faac8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions msi_perkeyrgb/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,19 @@ def main():
#
# HLS was chosen instead of HVL due to being more human-friendly
# see https://en.wikipedia.org/wiki/HSL_and_HSV#Motivation
col=webcolors.PercentRGB(
col_rgb_percent = webcolors.PercentRGB(
*colorsys.hls_to_rgb(
random.random(), # hue
random.random()*.5+.25, # lightness
random.random()*.5+.5 # saturation
)
)
colors_map, warnings = load_steady(
webcolors.rgb_percent_to_hex(["{:.2%}".format(val) for val in col])[1:],
msi_keymap
)
col_hex = webcolors.rgb_percent_to_hex(["{:.2%}".format(val) for val in col_rgb_percent])[1:]
colors_map, warnings = load_steady(col_hex,msi_keymap)
except ConfigError as e:
print("Error preparing steady color : %s" % str(e))
sys.exit(1)
print("Setting keyboard color as #{}".format(col_hex))
kb.set_colors(colors_map)
kb.refresh()

Expand Down
2 changes: 1 addition & 1 deletion msi_perkeyrgb/protocol_data/msi_keymaps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AVAILABLE_MSI_KEYMAPS = [

(['GE63', 'GE73', 'GE75', 'GS63', 'GS73', 'GS75', 'GX63', 'GT63', 'GL63'],
(['GE63', 'GE73', 'GE75', 'GS63', 'GS73', 'GS75', 'GX63', 'GT63', 'GL63', 'GL73'],
{9: 41,
10: 30,
11: 31,
Expand Down
2 changes: 1 addition & 1 deletion msi_perkeyrgb/protocol_data/presets_index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PRESETS_FILES = [
(['GE63', 'GE73', 'GE75', 'GS63', 'GS73', 'GS75', 'GX63', 'GT63', 'GL63'], '1.json'),
(['GE63', 'GE73', 'GE75', 'GS63', 'GS73', 'GS75', 'GX63', 'GT63', 'GL63', 'GL73'], '1.json'),
(['GS65'], '2.json')
]

0 comments on commit b1faac8

Please sign in to comment.