// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

BALL_INLINE
ColorUnitHue::operator String () const
{
  char temp[4];
  
  sprintf(&temp[0], "%x", (unsigned char)(value_ * 360.0));
  
  return String(&temp[0]);
}

BALL_INLINE
ColorUnitHue::operator short() const
{
  return (short)(value_ * (float)360.0);
}

BALL_INLINE
ColorUnitHue::operator unsigned short () const
{
  return (unsigned short)(value_ * (float)360.0);
}

BALL_INLINE 
ColorUnitHue::operator int () const
{
  return (int)(value_ * (float)360.0);
}

BALL_INLINE
ColorUnitHue::operator unsigned int () const
{
  return (unsigned int)(value_ * (float)360.0);
}

BALL_INLINE
ColorUnitHue::operator long () const
{
  return (long)(value_ * (float)360.0);
}

BALL_INLINE
ColorUnitHue::operator unsigned long () const
{
  return (unsigned long)(value_ * (float)360.0);
}

BALL_INLINE
ColorUnitHue::operator float () const
{
  return value_;
}

BALL_INLINE
ColorUnitHue::operator double () const
{
  return (double)value_;
}

BALL_INLINE
bool ColorUnitHue::operator ==
  (const ColorUnitHue& color_unit) const
{
  return Maths::isEqual(value_, color_unit.value_);
}

BALL_INLINE
bool ColorUnitHue::operator !=
  (const ColorUnitHue& color_unit) const
{
  return Maths::isNotEqual(value_, color_unit.value_);
}
    
BALL_INLINE
bool ColorUnitHue::operator <
  (const ColorUnitHue& color_unit) const
{
  return Maths::isLess(value_, color_unit.value_);
}
    
BALL_INLINE
bool ColorUnitHue::operator <=
  (const ColorUnitHue &color_unit) const
{
  return Maths::isLessOrEqual(value_, color_unit.value_);
}
    
BALL_INLINE
bool ColorUnitHue::operator >
  (const ColorUnitHue& color_unit) const
{
  return Maths::isGreater(value_, color_unit.value_);
}
    
BALL_INLINE
bool ColorUnitHue::operator >=
  (const ColorUnitHue &color_unit) const
{
  return Maths::isGreaterOrEqual(value_, color_unit.value_);
}
