mirror of https://github.com/espruino/BangleApps
weather: added monochrome parameter to `drawIcon`
parent
4433d2cef5
commit
81fb1dafb0
|
@ -21,3 +21,4 @@
|
||||||
0.22: Automatic translation of strings, some left untranslated.
|
0.22: Automatic translation of strings, some left untranslated.
|
||||||
0.23: Update clock_info to avoid a redraw
|
0.23: Update clock_info to avoid a redraw
|
||||||
0.24: Redraw clock_info on update and provide color field for condition
|
0.24: Redraw clock_info on update and provide color field for condition
|
||||||
|
0.25: Added monochrome parameter to drawIcon in lib
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
function weatherIcon(code) {
|
function weatherIcon(code) {
|
||||||
var ovr = Graphics.createArrayBuffer(24,24,1,{msb:true});
|
var ovr = Graphics.createArrayBuffer(24,24,1,{msb:true});
|
||||||
weatherLib.drawIcon({code:code},12,12,12,ovr);
|
weatherLib.drawIcon({code:code},12,12,12,ovr,true);
|
||||||
var img = ovr.asImage();
|
var img = ovr.asImage();
|
||||||
img.transparent = 0;
|
img.transparent = 0;
|
||||||
return img;
|
return img;
|
||||||
|
|
|
@ -155,14 +155,11 @@ exports.getColor = function(code) {
|
||||||
* @param y Top
|
* @param y Top
|
||||||
* @param r Icon Size
|
* @param r Icon Size
|
||||||
* @param ovr Graphics instance (or undefined for g)
|
* @param ovr Graphics instance (or undefined for g)
|
||||||
|
* @param monochrome If true, produce a monochromatic icon
|
||||||
*/
|
*/
|
||||||
exports.drawIcon = function(cond, x, y, r, ovr) {
|
exports.drawIcon = function(cond, x, y, r, ovr, monochrome) {
|
||||||
var palette;
|
var palette;
|
||||||
var monochrome=1;
|
if(!ovr) ovr = g;
|
||||||
if(!ovr) {
|
|
||||||
ovr = g;
|
|
||||||
monochrome=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
palette = getPalette(monochrome, ovr);
|
palette = getPalette(monochrome, ovr);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "weather",
|
"id": "weather",
|
||||||
"name": "Weather",
|
"name": "Weather",
|
||||||
"version": "0.24",
|
"version": "0.25",
|
||||||
"description": "Show Gadgetbridge weather report",
|
"description": "Show Gadgetbridge weather report",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}],
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
|
|
Loading…
Reference in New Issue