def color_from_code(code):
    """Generate a color based on a simple code

    Args:
        code (int): an integer going from 1 to 999

    Returns:
        [tuple]: the rgb color code 
    """

    if code == 0:
        return (255, 255, 255)

    assert code < 1000

    color = [0, 0, 0]

    for i, div in enumerate([100, 10, 1]):

        digit = (code // div) % 10
        color[i] = (255 // 9) * digit

    return color