SetColor

Général

jicehel

il y a 5 ans

Dans la doc, il est indiqué que l'on pouvit faire un setColor(Valeur Rouge, Valeur Vert, Valeur Bleue)  mais quand j'essaye, j'ai une erreur. Est-ce que je m'y prend mal ?

Du coup j'ai essayé un truc qui fonctionne presque:  gb.display.setColor(row * 12 * 65536 + column * 10 * 256 + row * 6 + column * 5);

Mais je n'obtiens pas ce que je veux, ça donne n'importe quoi alors que je voudrais un beau dégradé. 

Qui peut me donner la bonne formule ou syntaxe ?  Si ça marche, je vous rajoute une création avec un début de casse brique (fonctionnel mais à ses débuts qui sera amélioré avec le temps et vos remarques et propositions  ;) )


Sorunome

NEW il y a 5 ans

the red, green, blue colors are supposed to be different parameters:

uint8_t r = 42;
uint8_t g = 42;
uint8_t b = 42;
gb.display.setColor(r, g, b);


jicehel

NEW il y a 5 ans

yes but when i try to use that (it was my first try as i saw it in references), i have the message: no matching function for call to 'Gamebuino_Meta::Image::setColor(uint8t&, uint8t&,uint8t&) so i had idea to try to make my color in one unique value (as it's make no error when i try to compile, but separates values are alot more simple).

I don't know why it's make me always errors. It works on your programs when you try it ?

My code is exactly the same as your when i obtain error


jicehel

NEW il y a 5 ans

On proposed i have only one or 2 arg for this function (in the orange propositions of the debug error log). I think it's could be an error in the lib ?

Sorunome

NEW il y a 5 ans

Oh then that function is probably just in the git version yet, and isn't pushed out to release yet, my bad! So just wait for a bit or do gb.display.setColor(gb.createColor(r, g, b));

jicehel

NEW il y a 5 ans

Yes, great idea. It's works fine like this  ;)