I learned a very interesting technique today.
I needed a thought bubble icon and wanted to use a unicode character for this š.
However to my surprise I could not color this using CSS, despite in general this works with unicode characters. It turns out that some unicode characters are implemented as a bitmap and coloring does not work on them.
There is an interesting hack, that can solve this issue:
stackoverflow.com/questions/32413731/color-for-unicode-emoji/39776303#39776303
ššš {
āāššššš: ššššššššššš;
āāššš”š-šššššš : 0 0 0 ššš;
}
I have a DOM mapping, in which I wrap DOM elements in Javascript classes. You can set properties with member functions of this DOM wrapper class. Every setter functions returns the class, so you can chain this. I can say something like
š³šš().šš("#0š0").š (š·00).š(š·00)
and this would create a green 100 x 100 div.
Now I can create a new property setter, which can do all the above trick:
ššš(ššš”ššššššš ){
āāāšššš.š.ššš¢šš.ššš”ššššššš = ššš”ššššššš
āāāšššššš šššš
}
ššš(šššššš ššššš){
āāāšššššš šššš.š("ššššššššššš").ššš(`0 0 0 ${šššššš ššššš}`)
}
Note that I don't need "function" because this code is within a class definition.
From now on I can color unicode with one touch:
š³šš().šššš("š").ššš("#00š")
Looks like this:
I needed a thought bubble icon and wanted to use a unicode character for this š.
However to my surprise I could not color this using CSS, despite in general this works with unicode characters. It turns out that some unicode characters are implemented as a bitmap and coloring does not work on them.
There is an interesting hack, that can solve this issue:
stackoverflow.com/questions/32413731/color-for-unicode-emoji/39776303#39776303
ššš {
āāššššš: ššššššššššš;
āāššš”š-šššššš : 0 0 0 ššš;
}
I have a DOM mapping, in which I wrap DOM elements in Javascript classes. You can set properties with member functions of this DOM wrapper class. Every setter functions returns the class, so you can chain this. I can say something like
š³šš().šš("#0š0").š (š·00).š(š·00)
and this would create a green 100 x 100 div.
Now I can create a new property setter, which can do all the above trick:
ššš(ššš”ššššššš ){
āāāšššš.š.ššš¢šš.ššš”ššššššš = ššš”ššššššš
āāāšššššš šššš
}
ššš(šššššš ššššš){
āāāšššššš šššš.š("ššššššššššš").ššš(`0 0 0 ${šššššš ššššš}`)
}
Note that I don't need "function" because this code is within a class definition.
From now on I can color unicode with one touch:
š³šš().šššš("š").ššš("#00š")
Looks like this: