示例#1
0
def discrete():
    colormap = {
        'type': 'DiscreteColormap',
        'masked': MASKED,
        'invalid': INVALID,
        'data': [
            (0, (127, 000, 000, 255)),
            (2, (255, 000, 000, 255)),
        ],
        'labels': {'en_EN': {0: 'label0', 2: 'label2'}}
    }
    return colormaps.create(colormap)
示例#2
0
def gradient(size=3, log=False, free=True, interp=None):
    colormap = {
        'type': 'GradientColormap',
        'size': size,
        'free': free,
        'log': log,
        'interp': interp,
        'masked': MASKED,
        'data': [
            (3, (127, 000, 000, 255)),
            (5, (255, 000, 000, 255)),
        ],
    }
    return colormaps.create(colormap)