Skip to main content

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


Why don't you just do that anyway?  Pardon my ignorance but why do you need the convenience constructor to do this?



Bryan W Clark/Cambridge/IBM@IBMUS
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

08/06/2003 02:51 PM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        [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

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top