[Fxruby-users] Re: a color object
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2004-02-04 04:04:32
|
On Jan 30, 2004, at 11:06 PM, meinrad recheis wrote: > #color object (united fox functions) > class Color > attr_accessor :r, :g, :b, :a > #construct by red, green, blue and (optionally) alpha value > def initialize r=0, g=0, b=0, a=nil > @r,@g,@b,@a=r,g,b,a > end <snip> I have added this as a change request on the list at SourceForge: https://sourceforge.net/tracker/index.php? func=detail&aid=890161&group_id=20243&atid=370243 I could change things so that methods that currently expect an Integer for a FOX color value will accept either an Integer *or* an FXColor instance, e.g. widget.textColor = Fox.FXRGB(255, 0, 0) and: widget.textColor = Fox::FXColor.new(255, 0, 0) are equivalent. One concern, however, is how to handle return values for methods that currently return colors as Integers. That is, I think to preserve back-compatibility those methods would need to continue to return color values as integers. Any thoughts? Lyle |