imgclock: Add configurable color - and 'this is fine.'

master
Gordon Williams 2020-05-06 13:53:22 +01:00
parent 67135a3224
commit 8ad50eccf1
5 changed files with 8 additions and 4 deletions

View File

@ -168,7 +168,7 @@
"name": "Image background clock", "name": "Image background clock",
"shortName":"Image Clock", "shortName":"Image Clock",
"icon": "app.png", "icon": "app.png",
"version":"0.01", "version":"0.02",
"description": "A clock with an image as a background", "description": "A clock with an image as a background",
"tags": "clock", "tags": "clock",
"type" : "clock", "type" : "clock",

View File

@ -1 +1,2 @@
0.01: New App! 0.01: New App!
0.02: Add configurable color - and 'this is fine.'

View File

@ -27,6 +27,7 @@ function draw() {
// quickly set background image // quickly set background image
new Uint8Array(cg.buffer).set(bgimg); new Uint8Array(cg.buffer).set(bgimg);
// draw time // draw time
cg.setColor(inf.col);
cg.setFontAlign(-1,-1); cg.setFontAlign(-1,-1);
var x = 0; var x = 0;
cg.setFont("7x11Numeric7Seg",3); cg.setFont("7x11Numeric7Seg",3);

View File

@ -13,8 +13,9 @@
<script> <script>
var faces = [ var faces = [
{ img:"122240.png", bpp : 8, x:120, y:20, name:"Cityscape", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" }, { img:"122240.png", bpp : 8, x:120, y:20, col:"#FFFFFF", name:"Cityscape", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" },
{ img:"122271.png", bpp : 8, x:10, y:125, name:"Sunset", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" }, { img:"122271.png", bpp : 8, x:10, y:125, col:"#FFFFFF", name:"Sunset", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" },
{ img:"thisisfine.png", bpp : 8, x:85, y:5, col:"#000000", name:"This is fine.", attrib:"Gunshow #648", attribLink:"https://knowyourmeme.com/memes/this-is-fine", description:"" },
]; ];
document.querySelector(".columns").innerHTML = faces.map((face,facenumber)=>` document.querySelector(".columns").innerHTML = faces.map((face,facenumber)=>`
@ -44,7 +45,8 @@
var faceInfo = { var faceInfo = {
bpp : face.bpp, bpp : face.bpp,
x : face.x, x : face.x,
y : face.y y : face.y,
col : face.col
}; };
var img = document.querySelector(`img[face='${facenumber}']`); var img = document.querySelector(`img[face='${facenumber}']`);
var imgString = imageconverter.imagetoString(img, {mode:"web",output:"raw",compression:false}); var imgString = imageconverter.imagetoString(img, {mode:"web",output:"raw",compression:false});

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB