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

[BUG] color is supposed to override colorscheme in SphereStyleSpec and other StyleSpec, but it does not. #727

Closed
MaximeScope opened this issue Oct 13, 2023 · 2 comments
Labels

Comments

@MaximeScope
Copy link

Describe the bug
The documentation of SphereStyleSpec indicates that color should override colorscheme. However, looking through the code, it seems that the color is checked first and then colorscheme overrides it, which is the opposite of what is documented.

3Dmol.js/src/utilities.ts

Lines 549 to 552 in 79ccc58

let color = atom.color;
if (typeof style.color != "undefined" && style.color != "spectrum")
color = style.color;
if (typeof scheme != "undefined") {

Expected behavior
Documentation and code should agree!

Please close your issue when you feel it has been adequately resolved

@Luthaf
Copy link
Contributor

Luthaf commented Oct 13, 2023

Like for #726, I'm happy to send a PR for this once we decide on the resolution (modify the code or modify the docs).

dkoes added a commit that referenced this issue Oct 13, 2023
Document correct precedence for colorscheme/color
@dkoes
Copy link
Contributor

dkoes commented Oct 13, 2023

Thanks - given that the documentation is wrong, there are zero people relying on it being the way it is while there may be a nonzero amount of code relying on the behavior in the code so I prefer to change the docs (which I've done).

@dkoes dkoes closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants