Graphics::setColor

Description

void Graphics::setColor( Color | ColorIndex | uint8_t color [, Color | ColorIndex | uint8_t bgColor ] )

Graphics::setColor will set the current drawing color. You can also specify a background color. If none is specified the background color will be transparent. This is used for things like drawing text, setting pixels etc.

IMPORTANT!!! Colors are static, meaning that if you change the color on gb.light it will also change on gb.display etc.!

Parameters

  • Color | ColorIndex | uint8_t color: the color to set to
  • Color | ColorIndex | uint8_t gColor (optional): the background color to set to.

Returns

none

Example

#include <Gamebuino-Meta.h>

void setup() {
  gb.begin();
}

void loop() {
  if (gb.update()) {
    gb.clear();

    // set the color to draw
    gb.display.setColor(RED);

    gb.display.println("Red text");
  }
}