You are reading a single comment by @Andreas_Rozek and its replies. Click here to read the full conversation.
  • I just found this thread because I had problems with the few supported colors myself...

    For those interested: here is a short program displaying the supported colors

      let ScreenWidth = g.getWidth();
      
      let BarStart  = ScreenWidth/2, BarEnd = ScreenWidth-5;
      let BarHeight = 20;
    
      g.clear();
    
      let ColorNames  = 'black blue green cyan red magenta yellow white'.split(' ');
      let ColorValues = '#000000 [#0000FF](https://forum.espruino.com/search/?q=%230000FF) [#00FF00](https://forum.espruino.com/search/?q=%2300FF00) [#00FFFF](https://forum.espruino.com/search/?q=%2300FFFF) [#FF0000](https://forum.espruino.com/search/?q=%23FF0000) [#FF00FF](https://forum.espruino.com/search/?q=%23FF00FF) [#FFFF00](https://forum.espruino.com/search/?q=%23FFFF00) [#FFFFFF](https://forum.espruino.com/search/?q=%23FFFFFF)'.split(' ');
    
      g.setFont12x20();
      for (let i = 0; i < 8; i++) {
        let y = 20*i+5;
        
        g.setColor('#000000');
        g.drawString(ColorNames[i], 5,y);
        
        g.setColor(ColorValues[i]);
        g.fillRect(BarStart,y, BarEnd,y+BarHeight);
      }
    

    Edit: oops - the final Markdown renderer seems to completely misunderstand my color codes (and try to render them as links) - the "Preview" is still working!

    @Gordon you should have a look into the forum's code or ask the maintainers to fix that bug


    1 Attachment

    • BangleJS2-Basic-Colors.png
About