/* Blinker
   Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
   Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
   a blinkenarea.org project */

#ifndef BLINKER_COLOR_H
#define BLINKER_COLOR_H

#include <string>

namespace Blinker {

/// a color (24 bit RGB in web notation)
class Color
{
public:
  /// constructor
  Color();

public:
  /**
   * @brief parse from string
   * @param[in] str color as string in web format
   * @return if parsing was successful
   */
  bool fromStr(const std::string &str);

  /**
   * @brief convert to string
   * @return color as string in web format
   */
  std::string toStr() const;

public:
  unsigned char m_red;   ///< red channel of color
  unsigned char m_green; ///< red channel of color
  unsigned char m_blue;  ///< red channel of color
}; // class Color

} // namespace Blinker

#endif // #ifndef BLINKER_COLOR_H

