https://github.com/rozek/banglejs-2-bitmap-clock-background
fills the background of an analog clock on a Bangle.js 2 with a bitmap
https://github.com/rozek/banglejs-2-bitmap-clock-background
banglejs
Last synced: about 1 year ago
JSON representation
fills the background of an analog clock on a Bangle.js 2 with a bitmap
- Host: GitHub
- URL: https://github.com/rozek/banglejs-2-bitmap-clock-background
- Owner: rozek
- License: mit
- Created: 2022-01-09T10:18:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-01T05:55:35.000Z (over 4 years ago)
- Last Synced: 2025-01-29T20:30:11.550Z (over 1 year ago)
- Topics: banglejs
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# banglejs-2-bitmap-clock-background #
fills the background of an analog clock on a Bangle.js 2 with a bitmap
This module fills the background of an analog clock face for the [Bangle.js 2](https://www.espruino.com/Bangle.js2) with a given bitmap.

> Note: if you plan to use a bitmap background, you should consider including [Widgets on Background](https://github.com/rozek/banglejs-2-widgets-on-background) (as shown in the examples) in order to prevent widgets from erasing parts of that backgropund again.
## Usage ##
Within a clock implementation, the module may be used as follows:
```javascript
require('https://raw.githubusercontent.com/rozek/banglejs-2-widgets-on-background/main/drawWidgets.js');
let Clockwork = require(...);
Clockwork.windUp({
background: require('https://raw.githubusercontent.com/rozek/banglejs-2-bitmap-clock-background/main/ClockBackground.js.js'),
...
}, { Bitmap:'...' });
```
`Settings.Bitmap` should contain the file name of the bitmap to be drawn - that bitmap must have been properly converted for the Bangle.js 2 and uploaded into the storage area before.
## Example ##
The following code shows a complete example for a (still simple) analog clock using a bitmap background:
```javascript
require('https://raw.githubusercontent.com/rozek/banglejs-2-widgets-on-background/main/drawWidgets.js');
let Clockwork = require('https://raw.githubusercontent.com/rozek/banglejs-2-simple-clockwork/main/Clockwork.js');
Clockwork.windUp({
background:require('https://raw.githubusercontent.com/rozek/banglejs-2-bitmap-clock-background/main/ClockBackground.js'),
face: require('https://raw.githubusercontent.com/rozek/banglejs-2-four-numbered-face/main/ClockFace.js'),
complications:{
b:require('https://raw.githubusercontent.com/rozek/banglejs-2-date-complication/main/Complication.js')
}
},{
Foreground:'#FFFF00', Background:'#000000', Seconds:'#FF00',
Bitmap:'Mandelbrot_176x176.png'
});
```
## License ##
[MIT License](LICENSE.md)