Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] RGB Convenience Method

Hi ~

I would like to request a convenience constructor for the RGB class, I can 
fill out a bug in bugzilla if it's appropriate.  But I thought I'd ask 
first.

public static int UPPER_LIMIT = 255;

public RGB(int hashcode) {
        this( (hashcode & UPPER_LIMIT),(hashcode >> 8 & UPPER_LIMIT), 
(hashcode >> 16));
}

This would allow me to save (like in a preference save) RGB's as hashcodes 
and then bring them back from a single integer code.  Any thoughts?

Thanks,
~ Bryan

Bryan W Clark
Research Intern - Collaborative User Experience Group
Cambridge, MA USA



Back to the top