summaryrefslogtreecommitdiffstats
path: root/watch-library/simulator/shell.html
diff options
context:
space:
mode:
authorTom Hodson <thomas.c.hodson@gmail.com>2022-11-22 14:30:24 +0100
committerTom Hodson <thomas.c.hodson@gmail.com>2022-11-22 14:30:24 +0100
commit0b3a1ed24402bee9b2e5c242ea79cb51cfafd4a0 (patch)
treee3637e55a916cb3a569f301fc620794570a02c23 /watch-library/simulator/shell.html
parent2455a922c6c62dcb94106cef7214cf3f28c3ce55 (diff)
downloadSensor-Watch-0b3a1ed24402bee9b2e5c242ea79cb51cfafd4a0.tar.gz
Sensor-Watch-0b3a1ed24402bee9b2e5c242ea79cb51cfafd4a0.tar.bz2
Sensor-Watch-0b3a1ed24402bee9b2e5c242ea79cb51cfafd4a0.zip
WIP: Add support for bicolor led in the simulator
I noticed that the bicolor led isn't supported in the simulator. Here is a quick mockup of how I would add support for it. I added an SVG filter to the #light rectangle in the SVG which lets us multiply the colours by a matrix in code. I then insert values so that the original green colour gets mixed into the combination of red and green requested by `watch_set_led_color` # Testing So far I've only tested this with the standard firmware build but it seems to work. # Possible issues I wasn't 100% sure what to do when red + green > 255, current behaviour is that it gets clamped to 255 in the simulator.
Diffstat (limited to 'watch-library/simulator/shell.html')
-rw-r--r--watch-library/simulator/shell.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/watch-library/simulator/shell.html b/watch-library/simulator/shell.html
index 80e1e2ea..7b38a9aa 100644
--- a/watch-library/simulator/shell.html
+++ b/watch-library/simulator/shell.html
@@ -51,6 +51,14 @@
<stop offset="0.94" stop-color="#000d00" stop-opacity="0.05"/>
<stop offset="1" stop-opacity="0"/>
</radialGradient>
+ <filter id="ledcolor">
+ <feColorMatrix in="SourceGraphic" type="matrix"
+ values=" 0 0 0 0 0
+ 0 1 0 0 0
+ 0 0 0 0 0
+ 0 0 0 1 0 "/>
+
+ </filter>
</defs>
<g id="Calque">
<g id="Contours">
@@ -71,7 +79,7 @@
<rect x="293.5" y="520" width="683" height="334" rx="34.68" style="fill: #777b7a"/>
</g>
<g id="light" style="opacity: 0">
- <rect x="293.5" y="520" width="683" height="334" rx="34.68" style="fill: url(#Dégradé_sans_nom_3)"/>
+ <rect x="293.5" y="520" width="683" height="334" rx="34.68" style="fill: url(#Dégradé_sans_nom_3)" filter="url(#ledcolor)"/>
</g>
</g>
<g id="Textes">