• Hi! It depends a bit what platform you're aiming for...

    • @Robin's code is designed for neopixels and leans on Color.cvrtHexToDec which I think is a function that he's made (it's not in core Espruino).
    • @MaBe and @allObjects 16 bit colors will work great with Bangle.js or other 16 bit LCDs, but won't work on neopixels or 24 bit displays.

    One way of doing it that is efficient and portable between different displays is to use the hex string format that newer Espruino firmwares support:

    var red = "#ff0000"; // [#rrggbb](https://forum.espruino.com/sea­rch/?q=%23rrggbb)
    ...
    g.setColor(red);
    
About

Avatar for Guillaume_G @Guillaume_G started