[chimerax-users] transparency vs. opacity
Elaine Meng
meng at cgl.ucsf.edu
Wed May 4 11:41:09 PDT 2022
Hi Pranav,
I'm not sure what you are getting at, or what behavior is causing you problems. As far as I know, opacity/transparency are inextricably linked, i.e. one is always 1 minus the other. Maybe what is confusing is that surfaces "remember" their previous transparency, so if you made it transparent but then specify some (nontransparent) color, it will stay at the same transparency.
You can change surface transparency without affecting its RGB using the "transparency" command, or you can specify it directly in the "color" command by including an opacity component (= 1 - transparency) in the color specification. Hex codes may include opacity (e.g. if they are 8 characters instead of 6, or 12 instead of 9), RGBA values specify opacity A along with color RBG, etc. See "color specification":
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/colornames.html>
I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical ChemistryotherUniversity of California, San Francisco
> On May 4, 2022, at 9:57 AM, Pranav Shah via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>
> Hi Elaine,
> I am trying to control the opacity/transparency of maps..however it
> seems to me that these two different concepts within the framework
> although they are used to achieve the same effect... My understanding
> is that transparency controls the surface being displayed whereas
> opacity controls the opacity of the color assigned to the surface. Is
> there room to unify these two concepts in ChimeraX?
> On an operational level, how do I control the opacity of a color in
> chimeraX commandline? Currently I am assigning colors based on
> hexcodes for specific shades... but there isnt a way to take into
> account the opacity of that shade with hexcodes only...
> Best,
> Pranav
> --
> Pranav Shah
> Postdoctoral Research Fellow.
More information about the ChimeraX-users
mailing list