Pārlūkot izejas kodu

Issue #2: passing parameter to getColor

cycle20 2 gadi atpakaļ
vecāks
revīzija
ce561b4be2
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      src/extensions/tmdet/tmdet-color-theme.ts

+ 3 - 2
src/extensions/tmdet/tmdet-color-theme.ts

@@ -21,7 +21,7 @@ export function TmDetColorTheme(
     return {
         factory: TmDetColorTheme,
         granularity: 'group', //'residue' as any,
-        color: getColor,
+        color: (location: Location) => getColor(location, props),
         props: props,
         description: 'TMDet...',
     };
@@ -34,9 +34,10 @@ const ColorMap = [
     Color(0xffff00)
 ];
 
-function getColor(location: Location): Color {
+function getColor(location: Location, props: any): Color {
     let color = DefaultResidueColor;
 
+    console.log('getColor params:', props);
     if (StructureElement.Location.is(location) && Unit.isAtomic(location.unit)) {
         const compId = StructureElement.residueIndex(location) % 3;
         color = ColorMap[compId]