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

Coloring each residue by a hex code color #186

Open
ODIN987 opened this issue Jun 6, 2019 · 1 comment
Open

Coloring each residue by a hex code color #186

ODIN987 opened this issue Jun 6, 2019 · 1 comment

Comments

@ODIN987
Copy link

ODIN987 commented Jun 6, 2019

Hello i read the whole documentation but couldn't figure out how to color each residue based on its index by mapping it to an array of hexadecimal code for colors
example:
["#6a9374","#6a9374"]

residue 1 -> #6a9374
residue 2 -> #6a9374

@biasmv
Copy link
Owner

biasmv commented Jul 14, 2019

I think you might want to [https://pv.readthedocs.io/en/latest/coloring.html#adding-a-new-color-operation](add a custom color operation). The operation gets called for every atom to be colored. By going back to the residue of the atom, you can get its index (atom.residue().index()) and then use that to index into the color array. I hope that helps.

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

No branches or pull requests

2 participants