diff --git a/src/visGeometry/ColorHandler.ts b/src/visGeometry/ColorHandler.ts index 003ba209..fd221742 100644 --- a/src/visGeometry/ColorHandler.ts +++ b/src/visGeometry/ColorHandler.ts @@ -1,5 +1,6 @@ import { map, round, isEqual } from "lodash"; import { Color } from "three"; +import { AgentColorInfo } from "./types"; export function convertColorStringToNumber(color: number | string): number { if (typeof color !== "string") { @@ -195,10 +196,7 @@ class ColorHandler { return this.getColorById(index); } - public getColorInfoForAgentType(agentType: number): { - color: Color; - colorId: number; - } { + public getColorInfoForAgentType(agentType: number): AgentColorInfo { const color = this.getColorForAgentType(agentType); const colorId = this.getColorIdForAgentType(agentType); return { color, colorId }; diff --git a/src/visGeometry/types.ts b/src/visGeometry/types.ts index abca5d4e..85e998f7 100644 --- a/src/visGeometry/types.ts +++ b/src/visGeometry/types.ts @@ -1,4 +1,4 @@ -import { BufferGeometry, Object3D } from "three"; +import { BufferGeometry, Color, Object3D } from "three"; import PDBModel from "./PDBModel"; import { MRTShaders } from "./rendering/MultipassMaterials"; @@ -64,3 +64,8 @@ export interface GeometryStoreLoadResponse { geometry: MeshLoadRequest | PDBModel; errorMessage?: string; } + +export interface AgentColorInfo { + color: Color; + colorId: number; +}