Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] borderColor is broken for transparent colors #3652

Closed
cosmith opened this issue Oct 24, 2015 · 22 comments
Closed

[Android] borderColor is broken for transparent colors #3652

cosmith opened this issue Oct 24, 2015 · 22 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.

Comments

@cosmith
Copy link
Contributor

cosmith commented Oct 24, 2015

Setting borderColor: "rgba(255, 255, 255, 0.5)" works but borderColor: "rgba(255, 255, 255, 0.6)" gives a black border.

Expected:
screen shot 2015-10-24 at 10 39 16 am

Android:
screen shot 2015-10-24 at 10 39 10 am

Sample app: https://rnplay.org/apps/l1bw2A

@satya164
Copy link
Contributor

@cosmith Is this still an issue?

@cosmith
Copy link
Contributor Author

cosmith commented Jan 7, 2016

Sorry for the delay, still an issue on 0.16 but I haven't had the time to upgrade to 0.17 or 0.18.

@ataber
Copy link

ataber commented Jan 12, 2016

I'm seeing this in 0.17, however opacity of 0.5 also appears as black.

@scgough
Copy link

scgough commented Jan 13, 2016

I'm also seeing this in 0.17 on Android

I've tried a number of combinations...for e.g.

mystyle: { height:1, borderBottomWidth:1, borderColor:'rgba(255,255,255,0.5)', borderTopWidth:0, borderLeftWidth:0, borderRightWidth:0, },

@foghina
Copy link
Contributor

foghina commented Jan 18, 2016

Seeing this on master, seems related to color parsing? cc @andreicoman11

@Strainy
Copy link

Strainy commented Feb 24, 2016

Can confirm on 0.18, still an issue.

@slamus
Copy link

slamus commented Mar 4, 2016

+1

@marcshilling
Copy link

Happening in 0.22 still. Black border for any alpha value except 1.0.

@IanVS
Copy link

IanVS commented Mar 28, 2016

Happening still in 0.23.0-rc. It seems like instead of a real opacity being calculated, a different color value is being applied. So, the blacks turn into greys, but are fully opaque.

@jsangilve
Copy link

Still happening on 0.23-rc1

@hyugit
Copy link

hyugit commented Apr 6, 2016

anybody working on this??

@samuelpismel
Copy link

samuelpismel commented May 19, 2016

Still happening on 0.26 on Android

@omeid
Copy link
Contributor

omeid commented May 23, 2016

I have the same issue with 0.26 on ios as well.

@robertftw
Copy link

Still happens on 0.27.2

@mattvot
Copy link

mattvot commented Jul 4, 2016

@foghina, @andreicoman11, Is fixing this issue scheduled or in a backlog?

@foghina foghina removed their assignment Jul 4, 2016
@foghina foghina added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. labels Jul 4, 2016
@foghina
Copy link
Contributor

foghina commented Jul 4, 2016

Not that I know of. Added some tags to encourage people to send a PR to fix it :)

@fxhereng
Copy link

fxhereng commented Jul 7, 2016

+1

@anuragdadheech
Copy link

Waiting for the fix.

@hyugit
Copy link

hyugit commented Jul 14, 2016

I'll work on it. anyone who has already started, please let me know here.

@manicakes
Copy link

manicakes commented Aug 12, 2016

Hi all, I have a pull request to fix this here: #9380

Problem had to do with storing int value as float. This is lossy when converting back to int for very large numbers. To solve this I split color (ARGB) into RGB and Alpha values to be stored separately.

screen shot 2016-08-12 at 5 49 42 pm

ghost pushed a commit that referenced this issue Aug 15, 2016
Summary:
Fix for issue #3652 -

Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors.

So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects.

*Test Plan*

Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A

What currently looks like this:

<img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png">

Should look like this (with my fix applied):

<img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png">
Closes #9380

Differential Revision: D3716707

Pulled By: foghina

fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b
@manicakes
Copy link

Many thanks to @foghina for reviewing and getting the pull request merged in today - if @cosmith and others here can confirm this bug is fixed that would be appreciated!

@satya164
Copy link
Contributor

Closing this due to 8095707

Let's reopen if it's not fixed.

LearningDave pushed a commit to LearningDave/react-native that referenced this issue Aug 16, 2016
Summary:
Fix for issue facebook#3652 -

Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors.

So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects.

*Test Plan*

Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A

What currently looks like this:

<img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png">

Should look like this (with my fix applied):

<img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png">
Closes facebook#9380

Differential Revision: D3716707

Pulled By: foghina

fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b
mpretty-cyro pushed a commit to HomePass/react-native that referenced this issue Aug 25, 2016
Summary:
Fix for issue facebook#3652 -

Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors.

So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects.

*Test Plan*

Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A

What currently looks like this:

<img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png">

Should look like this (with my fix applied):

<img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png">
Closes facebook#9380

Differential Revision: D3716707

Pulled By: foghina

fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b
@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests