...although it may just be a mistake in the documentation - but it took me surprisingly long to find that out.
From the documentation of E.HSBtoRGB, you might be tempted to write
let Color = E.HSBtoRGB(i/Steps,1,1, true); g.setColor(Color[0],Color[1],Color[2]);
but this is wrong! You have to write
let Color = E.HSBtoRGB(i/Steps,1,1, true); g.setColor(Color[0]/255,Color[1]/255,Color[2]/255);
instead in order to get the expected results!
(Please note: you cannot simply write
let Color = E.HSBtoRGB(i/Steps,1,1); g.setColor(Color);
as the Bangle.js 2 does not support 24-bit color)
(see GitHub for some examples)
2 Attachments
@Andreas_Rozek started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
...although it may just be a mistake in the documentation - but it took me surprisingly long to find that out.
From the documentation of E.HSBtoRGB, you might be tempted to write
but this is wrong! You have to write
instead in order to get the expected results!
(Please note: you cannot simply write
as the Bangle.js 2 does not support 24-bit color)
(see GitHub for some examples)
2 Attachments