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.23: Update clock_info to avoid a redraw
|
||||
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) {
|
||||
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();
|
||||
img.transparent = 0;
|
||||
return img;
|
||||
|
|
|
@ -155,14 +155,11 @@ exports.getColor = function(code) {
|
|||
* @param y Top
|
||||
* @param r Icon Size
|
||||
* @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 monochrome=1;
|
||||
if(!ovr) {
|
||||
ovr = g;
|
||||
monochrome=0;
|
||||
}
|
||||
if(!ovr) ovr = g;
|
||||
|
||||
palette = getPalette(monochrome, ovr);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "weather",
|
||||
"name": "Weather",
|
||||
"version": "0.24",
|
||||
"version": "0.25",
|
||||
"description": "Show Gadgetbridge weather report",
|
||||
"icon": "icon.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
|
|
Loading…
Reference in New Issue