The sequel to clusterview. Built around the point and cluster structure of the kmeans project, aims to improve upon the design and structural weakness of clusterview and add many interesting interactive ways to explore kmeans.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
654 B

from enum import Enum
class Color(str, Enum):
BLUE = 'BLUE'
BLACK = 'BLACK'
GREY = 'GREY'
RED = 'RED'
ORANGE = 'ORANGE'
PURPLE = 'PURPLE'
@classmethod
def count(cls):
return len(cls.__members__)
# A simple map from Color -> RGBA 4-Tuple
# Note: The color values in the tuple are not RGB, but
# rather OpenGL percentage values for RGB.
COLOR_TO_RGBA = {
Color.GREY: (0.827, 0.827, 0.826, 0.0),
Color.BLUE: (0.118, 0.565, 1.0, 0.0),
Color.BLACK: (0.0, 0.0, 0.0, 0.0),
Color.RED: (1.0, 0.0, 0.0, 0.0),
Color.ORANGE: (0.98, 0.625, 0.12, 0.0),
Color.PURPLE: (0.60, 0.40, 0.70, 0.0)
}