Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-807] support gradient backgrounds

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:54:18.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.3.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:36:52.000+0000
Updated2011-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...

Comments

  1. Blain Hamon 2011-04-15

    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/

  2. Blain Hamon 2011-04-15

    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.

  3. Jeff Haynie 2011-04-15

    (from [2edf3e3557d2ddc030d013ec5f58373ad214549c]) Closes #807 http://github.com/appcelerator/titanium_mobile/commit/2edf3e3557d2ddc030d013ec5f58373ad214549c"> http://github.com/appcelerator/titanium_mobile/commit/2edf3e3557d2d...

JSON Source