Skip to content
Snippets Groups Projects
Unverified Commit 09ab8d62 authored by Alexander Rose's avatar Alexander Rose Committed by GitHub
Browse files

Merge pull request #796 from MadCatX/ntc-tube-uniform-color

Add a uniform color theme for NtC tube that still paints the residue and segment dividers in a different color
parents 50c1b667 8bf2fe62
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ Note that since we don't clearly distinguish between a public and private interf ...@@ -5,6 +5,7 @@ Note that since we don't clearly distinguish between a public and private interf
## [Unreleased] ## [Unreleased]
- Add a uniform color theme for NtC tube that still paints residue and segment dividers in a different color
## [v3.34.0] - 2023-04-16 ## [v3.34.0] - 2023-04-16
......
...@@ -31,7 +31,8 @@ type NtCTubeColors = typeof NtCTubeColors; ...@@ -31,7 +31,8 @@ type NtCTubeColors = typeof NtCTubeColors;
export const NtCTubeColorThemeParams = { export const NtCTubeColorThemeParams = {
colors: PD.MappedStatic('default', { colors: PD.MappedStatic('default', {
'default': PD.EmptyGroup(), 'default': PD.EmptyGroup(),
'custom': PD.Group(getColorMapParams(NtCTubeColors)) 'custom': PD.Group(getColorMapParams(NtCTubeColors)),
'uniform': PD.Color(Color(0xEEEEEE)),
}), }),
markResidueBoundaries: PD.Boolean(true), markResidueBoundaries: PD.Boolean(true),
markSegmentBoundaries: PD.Boolean(true), markSegmentBoundaries: PD.Boolean(true),
...@@ -43,7 +44,15 @@ export function getNtCTubeColorThemeParams(ctx: ThemeDataContext) { ...@@ -43,7 +44,15 @@ export function getNtCTubeColorThemeParams(ctx: ThemeDataContext) {
} }
export function NtCTubeColorTheme(ctx: ThemeDataContext, props: PD.Values<NtCTubeColorThemeParams>): ColorTheme<NtCTubeColorThemeParams> { export function NtCTubeColorTheme(ctx: ThemeDataContext, props: PD.Values<NtCTubeColorThemeParams>): ColorTheme<NtCTubeColorThemeParams> {
const colorMap = props.colors.name === 'default' ? NtCTubeColors : props.colors.params; const colorMap = props.colors.name === 'default'
? NtCTubeColors
: props.colors.name === 'custom'
? props.colors.params
: ColorMap({
...Object.fromEntries(ObjectKeys(NtCTubeColors).map(item => [item, props.colors.params])),
residueMarker: NtCTubeColors.residueMarker,
stepBoundaryMarker: NtCTubeColors.stepBoundaryMarker
}) as NtCTubeColors;
function color(location: Location, isSecondary: boolean): Color { function color(location: Location, isSecondary: boolean): Color {
if (NTT.isLocation(location)) { if (NTT.isLocation(location)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment