nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
824 stars 134 forks source link

custom rgb color #1090

Closed Dan-Burns closed 11 months ago

Dan-Burns commented 11 months ago

Hi,

If I try to assign a color to a shape, I end up with something different. Typically it's white or cyan.

Here's an example where I try to apply a green color.

image

Thank you for your help.

Dan

hainm commented 11 months ago

hi @Dan-Burns

Please use RGB code. e.g: for that green color, use [0, 128, 0]

image
hainm commented 11 months ago
image
Dan-Burns commented 11 months ago

Thanks @hainm. I take it that only a subset of colors can be depicted?

Dan-Burns commented 11 months ago

Actually, it appears I can just normalize the color by dividing the rgb vector by 256 and I get the desired color. Thanks again.