uniform.ts 678 B

1234567891011121314151617181920212223
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import { ColorTheme, ColorThemeProps, TableLegend } from '../color';
  7. import { Color } from 'mol-util/color';
  8. const DefaultColor = Color(0xCCCCCC)
  9. const Description = 'Gives everything the same, uniform color.'
  10. export function UniformColorTheme(props: ColorThemeProps): ColorTheme {
  11. const color = props.value || DefaultColor
  12. return {
  13. features: {},
  14. granularity: 'uniform',
  15. color: () => color,
  16. description: Description,
  17. legend: TableLegend([['uniform', color]])
  18. }
  19. }