Re: any other type of value for the "fromValue" property of CAAnimation?
Re: any other type of value for the "fromValue" property of CAAnimation?
- Subject: Re: any other type of value for the "fromValue" property of CAAnimation?
- From: David Duncan <email@hidden>
- Date: Fri, 11 Jul 2008 14:41:12 -0700
On Jul 11, 2008, at 5:38 AM, Cloud Strife wrote:
I am wondering whether I could set this property to NSColor or
CGColor
inorder to change the layer color dynamically. For example, If I
want to
change a Green layer to a red one from time to time, could anyone
give me a
guidance?
CGColorRefs are Core Foundatation data types, and therefore analogous
to NSObject decedents, thus you can typecast a CGColorRef to an id and
assign it as a fromValue or toValue of a CAAnimation without needing
to do any kind of conversion. Note however that NSColor and CGColorRef
are NOT toll-free bridged, therefore it is an error to assign an
NSColor where a CGColorRef is expected (or vise versa).
--
David Duncan
Apple DTS Animation and Printing
email@hidden
_______________________________________________
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