@@ -23,16 +23,6 @@ for (const key in saved_settings) {
2323 settings [ key ] = saved_settings [ key ] ;
2424}
2525
26-
27- //Colors to use
28- var color_options = [
29- 'Green' , 'Orange' , 'Cyan' , 'Purple' , 'Red' , 'Blue' , 'Yellow' , 'White' ,
30- 'Purple' , 'Pink' , 'Light Green' , 'Brown' , 'Turquoise' , 'Magenta' , 'Lime' ,
31- 'Gold' , 'Sky Blue' , 'Rose' , 'Lavender' , 'Amber' , 'Indigo' , 'Teal' ,
32- 'Crimson' , 'Maroon' , 'Firebrick' , 'Dark Red' , 'Aqua' , 'Emerald' , 'Royal Blue' ,
33- 'Sunset Orange' , 'Turquoise Blue' , 'Hot Pink' , 'Goldenrod' , 'Deep Sky Blue'
34- ] ;
35-
3626var bg_code = [
3727 '#00ff00' , '#FF9900' , '#0094FF' , '#FF00DC' , '#ff0000' , '#0000ff' , '#ffef00' , '#FFFFFF' ,
3828 '#FF00FF' , '#6C00FF' , '#99FF00' , '#8B4513' , '#40E0D0' , '#FF00FF' , '#00FF00' , '#FFD700' ,
@@ -78,6 +68,7 @@ let convert24to16 = function(input)
7868
7969//Converting colors to the correct format.
8070
71+ let color1C , color2C , color3C ; // fix lint warning no-undef
8172let randomColors = function ( ) {
8273
8374 if ( settings . randomColors ) {
@@ -290,9 +281,9 @@ let printRow = function(text, value, y, c){
290281 g . drawString ( text , 135 , y ) ;
291282
292283 // Plot text
293- width = g . stringWidth ( value ) ;
284+ const WIDTH = g . stringWidth ( value ) ;
294285 g . setColor ( cBlack ) ;
295- g . fillRect ( 130 - width - 8 , y - 2 , 130 , y + 18 ) ;
286+ g . fillRect ( 130 - WIDTH - 8 , y - 2 , 130 , y + 18 ) ;
296287 g . setColor ( c ) ;
297288 g . setFontAlign ( 1 , - 1 , 0 ) ;
298289 g . drawString ( value , 126 , y ) ;
@@ -853,9 +844,9 @@ Bangle.setUI({mode:"clock",remove:function() {
853844 Bangle . removeListener ( "lock" , onLock ) ;
854845 Bangle . removeListener ( "charging" , onCharge ) ;
855846 Bangle . removeListener ( "touch" , onTouch ) ;
856- require ( 'sched' ) . setAlarm ( TIMER_IDX , undefined ) ;
857847 g . setTheme ( themeBefore ) ;
858848 widget_utils . cleanup ( ) ;
849+ // NB: Leave TIMER_IDX alarm alone; timer should persist while leaving and returning to clock.
859850} } ) ;
860851Bangle . loadWidgets ( ) ;
861852// Clear the screen once, at startup and draw clock
0 commit comments