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

Fix a bug related to the alpha hex calculation #1048

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

dkniffin
Copy link
Contributor

I was running into an issue on OSX, where I'd set the backgroundColor to something like 'rgba(0, 0, 0, 0.8)', and everything would look great, until I closed Hyper, and re-opened it. Once I did that, it would still have transparency, but it'd be more transparent.

I tracked this down to the change I made. Basically, what was being done before is 0.8 would be converted to the decimal number 80, which is not correct. What should happen is that 0.8 should be a percentage of 100% opacity, which is 255, then converted to a hex string (via toString(16)). Hopefully that makes sense.

I'm not 100% sure, but I think this might also resolve #873, but I'd need @Lindenk to confirm.

@dkniffin
Copy link
Contributor Author

dkniffin commented Nov 28, 2016

Not sure if I should add this comment or not: // ┬──┬ ノ( ゜-゜ノ) :trollface:

@Lindenk
Copy link

Lindenk commented Nov 28, 2016

Well, the behavior is different this time. Rather than starting with an all white background, it looks normal until a reload, which might be what this fixes for me. Unfortunately transparency doesn't work at all now.

I'm running the default config with only the following hyper.js changes:

backgroundColor: 'rgba(0,0,0,0.6)',

showHamburgerMenu: true,

Well it was worth a try 😄

hyper_transparancy_bug

@Lindenk
Copy link

Lindenk commented Nov 28, 2016

Wait wait, apparently this only seems to be a problem when running in dev mode. Also, it looks like --enable-transparent-visuals and --disable-gpu weren't passed to the app when running in dev mode. It seems to work correctly when fully built for release.

After a bit more playing around, doing a full reload sets the transparency to 0, but by default, it seems to run as expected.

@dkniffin
Copy link
Contributor Author

@Lindenk So does this PR fix #873?

@Lindenk
Copy link

Lindenk commented Nov 28, 2016

This seems to fix (the more important) half of the issue. I'll make a new issue on the remaining problem with full-reload, but otherwise, yes this PR does fix the majority of the problem. Thanks!

@SirTimmyTimbit
Copy link

Please can someone review this? I've been having the same problem on Windows 10 x64, Hyper 1.0.0.

@dkniffin
Copy link
Contributor Author

Not exactly sure who has write access to this project, but looking at some recently merged PRs, @rauchg seems to. Would you mind taking a look over this and merging it? Thanks!

@ppot
Copy link
Contributor

ppot commented Dec 21, 2016

Can you rebase to latest master? @dkniffin

@dkniffin dkniffin force-pushed the bug/transparency-calculation branch from bac9962 to cda7544 Compare December 22, 2016 02:12
@dkniffin
Copy link
Contributor Author

@ppot Done.

@ppot ppot merged commit f2ffafb into vercel:master Dec 22, 2016
@dkniffin dkniffin deleted the bug/transparency-calculation branch December 22, 2016 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants