Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rap-dev] org.eclipse.swt.graphics.Color class problems in rap-1.1.0

It's okay. R is stored in the lowest byte (or first as you say) as 0xFF indicates.

Sebastian Bota wrote:
Hello RAP Developers.
Recently i have discovered a problem ("Feature") regarding the
org.eclipse.swt.graphics.Color class.

 public int getBlue() {
    return ( colorNr & 0xFF0000 ) >> 16; => This takes the value from
the first position, and SHOULD be the last position
  }
  public int getGreen() {
    return ( colorNr & 0xFF00 ) >> 8; => This is correct
  }

  public int getRed() {
    return colorNr & 0xFF;   => This is the last position and should be
the first
  }

The result is an inverted color i.e RED=FF0000 is 0000FF.
Please review this class or tell me if i am missing something.
Thank you

Sebastian Bota



Back to the top