brightness -r (p_rgb color)  
{
  with (color)
  {
    return math:round (->red +
                       ->green +
                       ->blue) / 3;                                            /* ??.. */
  }
}