Skip to content
Snippets Groups Projects
Commit 06b4761f authored by Alexander Rose's avatar Alexander Rose
Browse files

add ``carbonLightness`` to illustrative color theme

parent daa3d1db
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,8 @@ const DefaultIllustrativeColor = Color(0xEEEEEE); ...@@ -17,7 +17,8 @@ const DefaultIllustrativeColor = Color(0xEEEEEE);
const Description = `Assigns an illustrative color that gives every chain a unique color with lighter carbons (inspired by David Goodsell's Molecule of the Month style).`; const Description = `Assigns an illustrative color that gives every chain a unique color with lighter carbons (inspired by David Goodsell's Molecule of the Month style).`;
export const IllustrativeColorThemeParams = { export const IllustrativeColorThemeParams = {
...ChainIdColorThemeParams ...ChainIdColorThemeParams,
carbonLightness: PD.Numeric(0.8, { min: -6, max: 6, step: 0.1 })
}; };
export type IllustrativeColorThemeParams = typeof IllustrativeColorThemeParams export type IllustrativeColorThemeParams = typeof IllustrativeColorThemeParams
export function getIllustrativeColorThemeParams(ctx: ThemeDataContext) { export function getIllustrativeColorThemeParams(ctx: ThemeDataContext) {
...@@ -29,7 +30,7 @@ export function IllustrativeColorTheme(ctx: ThemeDataContext, props: PD.Values<I ...@@ -29,7 +30,7 @@ export function IllustrativeColorTheme(ctx: ThemeDataContext, props: PD.Values<I
function illustrativeColor(location: Location, typeSymbol: ElementSymbol) { function illustrativeColor(location: Location, typeSymbol: ElementSymbol) {
const baseColor = chainIdColor(location, false); const baseColor = chainIdColor(location, false);
return typeSymbol === 'C' ? Color.lighten(baseColor, 0.8) : baseColor; return typeSymbol === 'C' ? Color.lighten(baseColor, props.carbonLightness) : baseColor;
} }
function color(location: Location): Color { function color(location: Location): Color {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment