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](http://forum.espruino.com/sear­ch/?q=%230000FF) [#00FF00](http://forum.espruino.com/sear­ch/?q=%2300FF00) [#00FFFF](http://forum.espruino.com/sear­ch/?q=%2300FFFF) [#FF0000](http://forum.espruino.com/sear­ch/?q=%23FF0000) [#FF00FF](http://forum.espruino.com/sear­ch/?q=%23FF00FF) [#FFFF00](http://forum.espruino.com/sear­ch/?q=%23FFFF00) [#FFFFFF](http://forum.espruino.com/sear­ch/?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