Color

Color is a class that allow you to make some colors. Useful for texts and images.

Statics functions

  • white()

  • black()

  • transparent()

  • yellow()

  • orange()

  • blue()

  • pink()

  • grey()

  • green()

  • red()

these statics classes are made to create quickly a color.

You can call it like below:

#include "KapEngine.hpp"

KapEngine::Tools::Color myColor = KapEngine::Tools::Color::red();

Public functions

  • getR : get red value (0 - 255)

  • getG : get green value (0 - 255)

  • getB : get blue value (0 - 255)

  • getA : get alpha value (0 - 255)

  • setR : set red value (0 - 255)

  • setG : set green value (0 - 255)

  • setB : set blue value (0 - 255)

  • setA : set alpha value (0 - 255)

Create a color

#include "KapEngine.hpp"

KapEngine::Tools::Color color(255, 255, 255); // OK : alpha is set to 255

KapEngine::Tools::Color color(255, 255, 255, 0); // OK

KapEngine::Tools::Color color; // OK : white color is set

KapEngine::Tools::Color color(255, 255) // KO : missed 1 argument

KapEngine::Tools::Color color(255) // KO : missed 2 argument

Last updated