Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6412] Ti API: rgba() Color definitions use different units

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-04-22T05:10:28.000+0000
Affected Version/sRelease 1.7.3
Fix Version/sRelease 5.4.0
ComponentsTiAPI
Labelsparity, tbs-2.1.0
ReporterArthur Evans
AssigneeSrikanth Sombhatla
Created2011-12-01T12:55:16.000+0000
Updated2016-04-22T05:10:28.000+0000

Description

Both Android and iOS accept RGBA color definitions in the form: 'rgba(_red_,_green_,_blue_,_alpha_)' However, Android appears to expect RGBA values 0-255, while iOS expects floating-point values from 0 to 1. So 'rgba(128,128,128,64)' Yields a transparent medium-grey on Android, while on iOS you'd need to specify: 'rgba(.5,.5,.5,.25)' Strangely enough, passing that iOS color value to Android results, not in a transparent color as might be expected, but opaque yellow. It appears on further testing that on Android, any spaces or non-digit characters in the string will have the same result, so: 'rgba(128, 0,128,64)' ==> yellow 'rgba(128,0,128,64)' ==> expected color

Comments

  1. Arthur Evans 2012-02-16

    This was assigned to me because it was originally opened as an APIDoc bug. However, this is a parity issue.
  2. Michael Gangolf 2016-04-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/7955
  3. Srikanth Sombhatla 2016-04-22

    PR merged

JSON Source