3dmol / 3Dmol.js

WebGL accelerated JavaScript molecular graphics library
https://3dmol.org/
Other
794 stars 194 forks source link

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

Closed MaximeScope closed 11 months ago

MaximeScope commented 11 months ago

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.

https://github.com/3dmol/3Dmol.js/blob/79ccc580ab90fe9012e1c1cbc78229753314d102/src/utilities.ts#L549-L552

Expected behavior Documentation and code should agree!

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

Luthaf commented 11 months ago

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 commented 11 months ago

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).