from enum import Enum
from random import sample


class Colors(str, Enum):
    ALICEBLUE = "aliceblue"
    ANTIQUEWHITE = "antiquewhite"
    AQUA = "aqua"
    AQUAMARINE = "aquamarine"
    AZURE = "azure"
    BEIGE = "beige"
    BISQUE = "bisque"
    BLACK = "black"
    BLANCHEDALMOND = "blanchedalmond"
    BLUE = "blue"
    BLUEVIOLET = "blueviolet"
    BROWN = "brown"
    BURLYWOOD = "burlywood"
    CADETBLUE = "cadetblue"
    CHARTREUSE = "chartreuse"
    CHOCOLATE = "chocolate"
    CORAL = "coral"
    CORNFLOWERBLUE = "cornflowerblue"
    CORNSILK = "cornsilk"
    CRIMSON = "crimson"
    CYAN = "cyan"
    DARKBLUE = "darkblue"
    DARKCYAN = "darkcyan"
    DARKGOLDENROD = "darkgoldenrod"
    DARKGRAY = "darkgray"
    DARKGREEN = "darkgreen"
    DARKKHAKI = "darkkhaki"
    DARKMAGENTA = "darkmagenta"
    DARKOLIVEGREEN = "darkolivegreen"
    DARKORANGE = "darkorange"
    DARKORCHID = "darkorchid"
    DARKRED = "darkred"
    DARKSALMON = "darksalmon"
    DARKSEAGREEN = "darkseagreen"
    DARKSLATEBLUE = "darkslateblue"
    DARKSLATEGRAY = "darkslategray"
    DARKTURQUOISE = "darkturquoise"
    DARKVIOLET = "darkviolet"
    DEEPPINK = "deeppink"
    DEEPSKYBLUE = "deepskyblue"
    DIMGRAY = "dimgray"
    DODGERBLUE = "dodgerblue"
    FIREBRICK = "firebrick"
    FLORALWHITE = "floralwhite"
    FORESTGREEN = "forestgreen"
    FUCHSIA = "fuchsia"
    GAINSBORO = "gainsboro"
    GHOSTWHITE = "ghostwhite"
    GOLD = "gold"
    GOLDENROD = "goldenrod"
    GRAY = "gray"
    GREEN = "green"
    GREENYELLOW = "greenyellow"
    HONEYDEW = "honeydew"
    HOTPINK = "hotpink"
    INDIANRED = "indianred"
    INDIGO = "indigo"
    IVORY = "ivory"
    KHAKI = "khaki"
    LAVENDER = "lavender"
    LAVENDERBLUSH = "lavenderblush"
    LAWNGREEN = "lawngreen"
    LEMONCHIFFON = "lemonchiffon"
    LIGHTBLUE = "lightblue"
    LIGHTCORAL = "lightcoral"
    LIGHTCYAN = "lightcyan"
    LIGHTGOLDENRODYELLOW = "lightgoldenrodyellow"
    LIGHTGREEN = "lightgreen"
    LIGHTGREY = "lightgrey"
    LIGHTPINK = "lightpink"
    LIGHTSALMON = "lightsalmon"
    LIGHTSEAGREEN = "lightseagreen"
    LIGHTSKYBLUE = "lightskyblue"
    LIGHTSLATEGRAY = "lightslategray"
    LIGHTSTEELBLUE = "lightsteelblue"
    LIGHTYELLOW = "lightyellow"
    LIME = "lime"
    LIMEGREEN = "limegreen"
    LINEN = "linen"
    MAGENTA = "magenta"
    MAROON = "maroon"
    MEDIUMAQUAMARINE = "mediumaquamarine"
    MEDIUMBLUE = "mediumblue"
    MEDIUMORCHID = "mediumorchid"
    MEDIUMPURPLE = "mediumpurple"
    MEDIUMSEAGREEN = "mediumseagreen"
    MEDIUMSLATEBLUE = "mediumslateblue"
    MEDIUMSPRINGGREEN = "mediumspringgreen"
    MEDIUMTURQUOISE = "mediumturquoise"
    MEDIUMVIOLETRED = "mediumvioletred"
    MIDNIGHTBLUE = "midnightblue"
    MINTCREAM = "mintcream"
    MISTYROSE = "mistyrose"
    MOCCASIN = "moccasin"
    NAVAJOWHITE = "navajowhite"
    NAVY = "navy"
    OLDLACE = "oldlace"
    OLIVE = "olive"
    OLIVEDRAB = "olivedrab"
    ORANGE = "orange"
    ORANGERED = "orangered"
    ORCHID = "orchid"
    PALEGOLDENROD = "palegoldenrod"
    PALEGREEN = "palegreen"
    PALETURQUOISE = "paleturquoise"
    PALEVIOLETRED = "palevioletred"
    PAPAYAWHIP = "papayawhip"
    PEACHPUFF = "peachpuff"
    PERU = "peru"
    PINK = "pink"
    PLUM = "plum"
    POWDERBLUE = "powderblue"
    PURPLE = "purple"
    REBECCAPURPLE = "rebeccapurple"
    RED = "red"
    ROSYBROWN = "rosybrown"
    ROYALBLUE = "royalblue"
    SADDLEBROWN = "saddlebrown"
    SALMON = "salmon"
    SANDYBROWN = "sandybrown"
    SEAGREEN = "seagreen"
    SEASHELL = "seashell"
    SIENNA = "sienna"
    SILVER = "silver"
    SKYBLUE = "skyblue"
    SLATEBLUE = "slateblue"
    SLATEGRAY = "slategray"
    SNOW = "snow"
    SPRINGGREEN = "springgreen"
    STEELBLUE = "steelblue"
    TAN = "tan"
    TEAL = "teal"
    THISTLE = "thistle"
    TOMATO = "tomato"
    TURQUOISE = "turquoise"
    VIOLET = "violet"
    WHEAT = "wheat"
    WHITE = "white"
    WHITESMOKE = "whitesmoke"
    YELLOW = "yellow"
    YELLOWGREEN = "yellowgreen"

    def __repr__(self):
        return self._value_

    def __str__(self):
        return f'{self._value_}'

    __iter_idx__ = 0
    __shuffle_idx__ = 0
    __shuffled__ = sample(range(141), 141)

    @classmethod
    def next(cls):
        cls.__iter_idx__ = (int(cls.__iter_idx__) + 1) % len(cls)
        return list(cls)[cls.__iter_idx__ - 1]

    @classmethod
    def random(cls):
        cls.__shuffle_idx__ = (int(cls.__shuffle_idx__) + 1) % 141
        return list(cls)[int(cls.__shuffled__[cls.__shuffle_idx__ - 1])]


if __name__ == '__main__':
    print(Colors.next())
    print(Colors.random())
