Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Arduino library that converts HSB values into RGB. Enables you to determine the values for RGB leds from hue, saturation and brightness values..
C++ C
branch: master

Merge pull request #1 from marijnvriens/master

Changed a dependency it so it also works with Arduino 1.0 IDE.
latest commit ff916aa8c7
@julioterra authored
Failed to load latest commit information.
HSBColor.cpp deleting old unused files
HSBColor.h Fixing for Arduino 1.0
README.md Update README.md

README.md

HSB_Color

The HSB Color library converts HSB colors values to RGB color values. It was designed to drive rgb leds using hue, saturation and brightness values.

Installing the Library

  • Download the library zip file from Github
  • Unzip the downloaded file
  • Copy HSB_Color folder into Arduino libraries folder
  • Launch (or restart) the Arduino IDE

Using the Library

The HSB library provides two different methods that convert HSB to RGB values. They both accept the 4 parameters, three number values and a pointer to an integer array. They differ in that one of them accepts three integers, while the other accepts three float.

The RGB values are saved into the integer array that is passed as the fourth parameter of each method. RGB values will range between 0 and 255. Make sure the array can accommodate three integers, otherwise the sketch won't work (though it may compile).

Integer Method

void H2R_HSBtoRGB(int hue, int saturation, int brightness, int* rbg_array);

Value Range:

  • hue: 0 - 359
  • saturation: 0 - 99
  • brightness: 0 - 99

Float Method

void H2R_HSBtoRGBfloat(float hue, float saturation, float brightness, int* rbg_array);

Float Value Range:

  • hue: 0.0 - 1.0
  • saturation: 0.0 - 1.0
  • brightness: 0.0 - 1.0
Something went wrong with that request. Please try again.