• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
bug in NSGradient?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in NSGradient?


  • Subject: bug in NSGradient?
  • From: Graham Cox <email@hidden>
  • Date: Sat, 22 Nov 2008 21:12:55 +1100

Just noticed this, not what I was expecting. I'll file a bug unless someone can convincingly explain it's correct behaviour...

[NSGradient interpolatedColorAtLocation:<value>];

If the gradient has stops that run from, say, 0.5 to 1.0, but <value> is less than 0.5, this method returns nil. I would have expected it to return the extended colour, i.e. the first one in this case.

The discussion for this method says:

"This method does not simply return the color values used to initialize the receiver. Instead, it computes the value that would be drawn at the specified location."

For the case above this depends on whether the gradient will be drawn with the colour extending flags set, but since this method doesn't know about those flags, it's not well-defined. I would suggest that the method should assume the flags are set, since that's a useful assumption, whereas the opposite isn't.

Also, the discussion says:

"The start color of the gradient is always located at 0.0 and the end color is always at 1.0."

Which is simply untrue.


--Graham




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: bug in NSGradient?
      • From: "Stephen J. Butler" <email@hidden>
  • Prev by Date: More instability in Distributed Objects used between multithreaded processes?
  • Next by Date: Testing components within an application
  • Previous by thread: More instability in Distributed Objects used between multithreaded processes?
  • Next by thread: Re: bug in NSGradient?
  • Index(es):
    • Date
    • Thread