diff --git a/src/mol-util/color/color.ts b/src/mol-util/color/color.ts index 21f28c78551c937499226ff17b3f872f56b4bebf..ea0c4efc0d8803f383cc94598c1e6bbdff017b41 100644 --- a/src/mol-util/color/color.ts +++ b/src/mol-util/color/color.ts @@ -5,11 +5,11 @@ */ /** RGB color triplet expressed as a single number */ -type Color = { readonly '@type': 'color' } & number +export type Color = { readonly '@type': 'color' } & number -function Color(hex: number) { return hex as Color } +export function Color(hex: number) { return hex as Color } -namespace Color { +export namespace Color { export function toRgb(hexColor: Color) { return [ hexColor >> 16 & 255, hexColor >> 8 & 255, hexColor & 255 ] } @@ -53,4 +53,8 @@ namespace Color { } } -export default Color \ No newline at end of file +type ColorTable<T extends { [k: string]: number[] }> = { [k in keyof T]: Color[] } +export function ColorTable<T extends { [k: string]: number[] }>(o: T) { return o as ColorTable<T> } + +type ColorMap<T extends { [k: string]: number }> = { [k in keyof T]: Color } +export function ColorMap<T extends { [k: string]: number }>(o: T) { return o as ColorMap<T> } \ No newline at end of file diff --git a/src/mol-util/color/index.ts b/src/mol-util/color/index.ts index dbf65d1e9c094d2f1f41085ee8df0d91e80a40cd..2332d4a24ec9502444a54e46e15a1b546b412f49 100644 --- a/src/mol-util/color/index.ts +++ b/src/mol-util/color/index.ts @@ -4,14 +4,6 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import Color from './color' -import { ColorScale } from './scale'; - -type ColorTable<T extends { [k: string]: number[] }> = { [k in keyof T]: Color[] } -export function ColorTable<T extends { [k: string]: number[] }>(o: T) { return o as ColorTable<T> } - -type ColorMap<T extends { [k: string]: number }> = { [k in keyof T]: Color } -export function ColorMap<T extends { [k: string]: number }>(o: T) { return o as ColorMap<T> } - -export { Color, ColorScale } +export { Color, ColorMap, ColorTable } from './color' +export { ColorScale } from './scale'; export { ColorBrewer, ColorNames } from './tables' \ No newline at end of file diff --git a/src/mol-util/color/scale.ts b/src/mol-util/color/scale.ts index f60fe54bafa9bc261e2cd51ef4040a6e045badaf..f03b7539969d8af3a7f29f46592d95a9625e8670 100644 --- a/src/mol-util/color/scale.ts +++ b/src/mol-util/color/scale.ts @@ -4,7 +4,7 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import Color from './color' +import { Color } from './color' import { ColorBrewer } from './tables' export interface ColorScale { diff --git a/src/mol-util/color/tables.ts b/src/mol-util/color/tables.ts index dbaf80d5523e2774153afe51a7fcbb3518534907..a9012c3ea2c22a9ed28d914abdab9e75b32f728e 100644 --- a/src/mol-util/color/tables.ts +++ b/src/mol-util/color/tables.ts @@ -4,7 +4,7 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { ColorMap, ColorTable } from './index'; +import { ColorMap, ColorTable } from './color'; /** * Brewer Color Lists