Change luminance in color palette

I am coloring surfaces using palettes (purples or a custom green-white-magenta). These both have a single luminance value, is it possible to generate a color palette that also has changing luminance. The ideal palette would be green -> white -> magenta along the color axis, and 0 - > 255 scaling the luminance of the rgb. We would effectively have a color bar matrix that goes from dark green to black to dark magenta if the values are low and bright green to white to bright magenta if the values are high. Thanks for your insights! -Brandon Brandon Scott, PhD CZI Imaging Scientist, Assistant Professor Nanoscience & Biomedical Engineering South Dakota Mines EEP 229 501 E. Saint Joseph St., Rapid City, SD 57701 724.510.1253 | Brandon.Scott@sdsmt.edu<mailto:Brandon.Scott@sdsmt.edu> [South Dakota Mines]<https://www.sdsmt.edu/>

Hi Brandon! There is no built-in capability for 2D palettes. You can use RGB, Hex, etc. to define the colors in a palette, so it can be any colors you want, see the "color1:color2:color3" or "value,color" pairs options: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/color.html#palette-options> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/colornames.html> However, if you were looking for some (semi)automatic way to scale a set of existing colors, see "color modify": <https://rbvi.ucsf.edu/chimerax/docs/user/commands/color.html#modify> That command allows adjusting lightness (not sure if that is the same as luminance) but because different colors start out at different lightnesses, applying uniform scaling is likely to make some values "max out" sooner than others, losing the distinction among them. You can experiment with it and see what you think, however. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 20, 2022, at 2:03 PM, Scott, Brandon L. via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
I am coloring surfaces using palettes (purples or a custom green-white-magenta). These both have a single luminance value, is it possible to generate a color palette that also has changing luminance. The ideal palette would be green -> white -> magenta along the color axis, and 0 - > 255 scaling the luminance of the rgb. We would effectively have a color bar matrix that goes from dark green to black to dark magenta if the values are low and bright green to white to bright magenta if the values are high.
Thanks for your insights! -Brandon
Brandon Scott, PhD CZI Imaging Scientist, Assistant Professor Nanoscience & Biomedical Engineering South Dakota Mines EEP 229 501 E. Saint Joseph St., Rapid City, SD 57701 724.510.1253 | Brandon.Scott@sdsmt.edu
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Hi Elaine, Thanks for this clarity! I was having a moment there trying to describe what I was after. It was actually much simplier, I just wanted to make a composite colormap with green and magenta, which is working now 🙂 Brandon Scott, PhD CZI Imaging Scientist, Assistant Professor Nanoscience & Biomedical Engineering South Dakota Mines EEP 229 501 E. Saint Joseph St., Rapid City, SD 57701 724.510.1253 | Brandon.Scott@sdsmt.edu<mailto:Brandon.Scott@sdsmt.edu> [South Dakota Mines]<https://www.sdsmt.edu/> ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Thursday, October 20, 2022 4:59 PM To: Scott, Brandon L. <Brandon.Scott@sdsmt.edu> Cc: ChimeraX-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: [EXT] Re: [chimerax-users] Change luminance in color palette *** This email is from an EXTERNAL sender. Use CAUTION before opening attachments or clicking links.*** Hi Brandon! There is no built-in capability for 2D palettes. You can use RGB, Hex, etc. to define the colors in a palette, so it can be any colors you want, see the "color1:color2:color3" or "value,color" pairs options: <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fcolor.html%23palette-options&data=05%7C01%7CBrandon.Scott%40sdsmt.edu%7Cdcc38382edc243a1ad1c08dab2eecbed%7C867083e60b14435f9b4e8be26f01d84e%7C0%7C0%7C638019035950569889%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mtgyrR1hPDTQMzxeIuRbWO56AngJ9yXcpT2OJBpoCF8%3D&reserved=0> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fcolornames.html&data=05%7C01%7CBrandon.Scott%40sdsmt.edu%7Cdcc38382edc243a1ad1c08dab2eecbed%7C867083e60b14435f9b4e8be26f01d84e%7C0%7C0%7C638019035950569889%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=cTRMl6hE61s%2BFgPrehRvva6C99aWKELuffQFRv7KmIk%3D&reserved=0> However, if you were looking for some (semi)automatic way to scale a set of existing colors, see "color modify": <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fcolor.html%23modify&data=05%7C01%7CBrandon.Scott%40sdsmt.edu%7Cdcc38382edc243a1ad1c08dab2eecbed%7C867083e60b14435f9b4e8be26f01d84e%7C0%7C0%7C638019035950569889%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IiGaXhmOV2qGlom5C8klrmut%2BwwlapzUvyhaBbfn5%2FA%3D&reserved=0> That command allows adjusting lightness (not sure if that is the same as luminance) but because different colors start out at different lightnesses, applying uniform scaling is likely to make some values "max out" sooner than others, losing the distinction among them. You can experiment with it and see what you think, however. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 20, 2022, at 2:03 PM, Scott, Brandon L. via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
I am coloring surfaces using palettes (purples or a custom green-white-magenta). These both have a single luminance value, is it possible to generate a color palette that also has changing luminance. The ideal palette would be green -> white -> magenta along the color axis, and 0 - > 255 scaling the luminance of the rgb. We would effectively have a color bar matrix that goes from dark green to black to dark magenta if the values are low and bright green to white to bright magenta if the values are high.
Thanks for your insights! -Brandon
Brandon Scott, PhD CZI Imaging Scientist, Assistant Professor Nanoscience & Biomedical Engineering South Dakota Mines EEP 229 501 E. Saint Joseph St., Rapid City, SD 57701 724.510.1253 | Brandon.Scott@sdsmt.edu
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fmailman%2Flistinfo%2Fchimerax-users&data=05%7C01%7CBrandon.Scott%40sdsmt.edu%7Cdcc38382edc243a1ad1c08dab2eecbed%7C867083e60b14435f9b4e8be26f01d84e%7C0%7C0%7C638019035950569889%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=X8EzktVnzGwQFsO39rl7z4bVz4isFupMyecIQYG4JXg%3D&reserved=0
participants (2)
-
Elaine Meng
-
Scott, Brandon L.