Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Predefined colors impossible to use on Atom v1.25.0-beta0 #462

Open
Arcanemagus opened this issue Feb 13, 2018 · 18 comments
Open

Predefined colors impossible to use on Atom v1.25.0-beta0 #462

Arcanemagus opened this issue Feb 13, 2018 · 18 comments

Comments

@Arcanemagus
Copy link

[Short description of problem here]

Reproduction Steps:

  1. Open Atom v1.25.0-beta0 with atom-material-ui installed
  2. Attempt to set a predefined color (eg. "Green")

Expected behavior:

Predefined color to be set.

Observed behavior:

These errors are printed to the console:

Error setting item in object: Validation failed at atom-material-ui.colors.abaseColor, {"_alpha":1,"_blue":117,"_green":216,"_red":170} cannot be coerced into a color
coerce @ <embedded>:22846
executeSchemaEnforcers @ <embedded>:21894
coerce @ <embedded>:22844
executeSchemaEnforcers @ <embedded>:21894
makeValueConformToSchema @ <embedded>:22641
set @ <embedded>:22207
transact @ <embedded>:22458
transact @ <embedded>:22320
resetUserSettings @ <embedded>:22455
disposables.add.applicationDelegate.onDidChangeUserSettings.settings @ <embedded>:1040
outerCallback @ <embedded>:1895
emitThree @ events.js:121
emit @ events.js:197

Error setting item in object: Validation failed at atom-material-ui.colors.accentColor, {"_alpha":1,"_blue":83,"_green":136,"_red":111} cannot be coerced into a color

And then after a very short delay the theme reverts to the default (Teal).

Screenshots and GIFs

2018-02-13_13-49-08

Atom version:

Atom    : 1.25.0-beta0
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

OS and version:

Windows 10 x64 Enterprise

Installed packages:

Installed packages
Dev Packages (3) C:\Users\abneyl\.atom\dev\packages
├── [email protected]
├── [email protected]
└── [email protected]

Community Packages (81) C:\Users\abneyl\.atom\packages
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
@phyllisstein
Copy link

Same results on macOS when trying to set theme colors with the color picker, for what it's worth.

@Evpok
Copy link

Evpok commented Feb 14, 2018

Same on Linux (Plasma/X11), with both predefined and colour picker.

@Nxt3
Copy link

Nxt3 commented Feb 14, 2018

Setting the colors works for me--but every time Atom is opened I have to re-select the colors.

@alexdevero
Copy link

I have the same issue as @Nxt3. The color setting works only until Atom is closed. Colors are reset after Atom is opened again.

@alexdevero
Copy link

alexdevero commented Feb 15, 2018

A workaround until this issue is fixed:

  1. Open init script (File -> Init Script ...)
  2. Add following code to "force-change" theme base colors when Atom start
# Force-set theme base (primary) color 
atom.config.set('atom-material-ui.colors.abaseColor', 'rgba(0, 166, 255, 1)')

# Force-set theme base (secondary) color 
atom.config.set('atom-material-ui.colors.accentColor', 'rgba(0, 166, 255, 1)')

There might be a small lag of a second or two before colors are applied.

@silvestreh
Copy link
Member

silvestreh commented Feb 15, 2018

I'm having the issue where it resets the colors back to default values on startup. I already have a fix for that (the fix I had broke other stuff), but I cannot reproduce the one in OP

@Evpok
Copy link

Evpok commented Feb 15, 2018

Trying to reproduce today I too only have the issue on startup and not the one in OP.

@phyllisstein
Copy link

I've had luck reproducing the original issue when multiple Atom windows are open. My understanding is that each window runs through the "startup" process independently, so that might be contributing to the quick-fallback behavior.

@silvestreh
Copy link
Member

@phyllisstein thanks for that! at a first glance, it looks like it's an issue with Atom itself, but I'll have to investigate further and hopefully find a workaround.

On the bright side, I now did find a fix for the color resetting issue. I'll be pushing an update in the next couple minutes.

@Arcanemagus
Copy link
Author

Sorry, just to be clear it wouldn't surprise me at all if this was an issue with the beta, it includes an update to Electron which usually has unintended side effects. I was busy filing and fixing a bunch of other things that popped up and forgot to come back here to do more detailed testing 😉.

@silvestreh
Copy link
Member

@Arcanemagus, yeah totes. I'll keep an eye on this though.

@phyllisstein
Copy link

Sad to say the fix only seems to work until you pop open a new Atom window. Attached a screencast to demonstrate.

screenflow

@robertrossmann
Copy link
Contributor

robertrossmann commented Feb 16, 2018

This is most likely not related to this package - I have observed similar issues with platformio-ide-terminal package where configuration values which represent colours in hex format are for some reason automatically re-formatted into an object with individual colour components (_alpha, _red, _green, _blue which in turn caused the packages depending on that configuration value to fail to understand this format.

So I'd bet this is related to Atom 1.25-beta.0.

@Arcanemagus
Copy link
Author

@50Wliu could this have been broken by atom/atom#16161 somehow?

@winstliu
Copy link

I would be super-surprised if it was. I can't guarantee I'll have time to investigate but if I do I'll try reverting that PR and seeing if it helps.

@Arcanemagus
Copy link
Author

I know from past investigations that .toString() gets called on the values sent in, which is why I'm suspicious of it.

@winstliu
Copy link

Not caused by atom/atom#16161. Especially since .toString() would have previously returned [object Object] anyway which would have been even more incorrect. A different PR that may be related is atom/atom#16628.

@Arcanemagus
Copy link
Author

This is definitely caused by atom/atom#16628, I built atom/atom@a48624d and it had no issues, building atom/atom@e74ea47 (since atom/atom@2923f00 was giving me a few issues I skipped ahead 3 commits) and I can replicate this issue when using a second window.

I'll file an issue on atom/atom about this. @silvestreh feel free to close this or leave it open to make it obvious to find for others hitting this issue 😉.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants