[TIMOB-807] support gradient backgrounds
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.3.0 |
Components | iOS |
Labels | n/a |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:36:52.000+0000 |
Updated | 2011-04-17T01:54:18.000+0000 |
Description
see premium ticket:
http://helpdesk.appcelerator.net/tickets/2058">http://helpdesk.appcelerator.net/tickets/2058
also see this Objective-C class:
http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CAGradientLayer_class/Reference/Reference.html"> http://developer.apple.com/iphone/library/documentation/GraphicsIma...
Notes to self: Looking up examples from javascript and CSS on how to expose it.
http://webkit.org/blog/175/introducing-css-gradients/">http://webkit.org/blog/175/introducing-css-gradients/
http://css-tricks.com/css3-gradients/">http://css-tricks.com/css3-gradients/
http://weston.ruter.net/projects/css-gradients-via-canvas/">http://weston.ruter.net/projects/css-gradients-via-canvas/
Okay, this looks more involved then I thought if we give them all the flexibility of CGGradient.
If we want to match CGGradient, we have a gradient object that's an array of colors, and an optional array of floats. The floats indicate the distance along the gradient that the color's expressed. If the array is omitted, the gradient colors are distributed evenly.
This would be used as an argument in two methods, both painting to an image blob, one for radial, the other linear.
Radial would take the gradient, a start location and radius, an end location and radius, and two options.
Linear would take the gradient, a start location, an end location, and the two options.
The two notable options are booleans. The first allows the color to be filled beyond the beginning of the gradient, the other fills the color beyond the end. We'll have to talk this over on Friday to figure out what's the best balance between the CGGradient model and the CSS gradient models.
(from [2edf3e3557d2ddc030d013ec5f58373ad214549c]) Closes #807 http://github.com/appcelerator/titanium_mobile/commit/2edf3e3557d2ddc030d013ec5f58373ad214549c"> http://github.com/appcelerator/titanium_mobile/commit/2edf3e3557d2d...