weather: added monochrome parameter to `drawIcon`

pull/2630/head
Gabriele Monaco 2023-03-04 15:56:50 +01:00
parent 4433d2cef5
commit 81fb1dafb0
4 changed files with 6 additions and 8 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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"}],