Page 1 of 1

color of a png file

Posted: Thursday 16 December 2021 22:42
by pvklink
Hi i try to change the coler oa an internal image, that possible ?

blocks[86] = {title: 'Rolluik', hide_data: true, width: 4, imageOff: 'curtainclosed.png', imageOn: 'curtainopen.png'} //, speak: 'Rolluik is
gewijzigd'


I tried all of these below...

Code: Select all


.fa-curtainclosed.on {color: gold;}
.fa-curtainclosed.off {color: gold;}
.fa-curtainopen.on {color: gold;}
.fa-curtainopen.off {color: gold;}

.fa-curtainclosed {color: gold;}
.fa-curtainclosed {color: gold;}
.fa-curtainopen {color: gold;}
.fa-curtainopen {color: gold;}

.block_86 .on {
  color:gold;
}

.block_86 .off {
  color:gold;
}

.fas.fa-curtainclosed {
    color: gold
}
.fas.fa-curtainopen {
    color: gold
}


Re: color of a png file

Posted: Friday 17 December 2021 17:52
by HansieNL
The image is an .png file and it is not simple to change the color by css. Only font and svg icons can be simply changed by css.
The easiest way is to edit the images and put them in the custom folder and load them from there. I changed the images to have an golden look. If you like them you can save them to your Dashticz custom folder.

imageOff: '../custom/curtainclosed_gold.png',
imageOn: '../custom/curtainopen_gold.png
curtainopen_gold.png
curtainopen_gold.png (1.75 KiB) Viewed 409 times
curtainclosed_gold.png
curtainclosed_gold.png (2.92 KiB) Viewed 409 times

Re: color of a png file

Posted: Saturday 18 December 2021 10:31
by pvklink
yes, that did work !
Thanks Hansie