def step_impl(context): testing.assert_color_equal(context.color_map.color(-1), [0.23003265, 0.29899933, 0.75400176, 1.]) testing.assert_color_equal(context.color_map.color(0), [0.23003265, 0.29899933, 0.75400176, 1.]) testing.assert_color_equal(context.color_map.color(0.5), [0.86539042, 0.86541865, 0.86532601, 1.]) testing.assert_color_equal(context.color_map.color(1), [0.7059977, 0.01612647, 0.15000112, 1.]) testing.assert_color_equal(context.color_map.color(2), [0.7059977, 0.01612647, 0.15000112, 1.])
def step_impl(context): testing.assert_color_equal( context.color_map.color(-1), (1, 0, 0, 1)) testing.assert_color_equal( context.color_map.color(0), (1, 0, 0, 1)) testing.assert_color_equal( context.color_map.color(0.5), (0.5, 0, 0.5, 1)) testing.assert_color_equal( context.color_map.color(1), (0, 0, 1, 1)) testing.assert_color_equal( context.color_map.color(2), (0, 0, 1, 1))
def step_impl(context): testing.assert_color_equal( context.color_map.color(-1), [0.23003265, 0.29899933, 0.75400176, 1.]) testing.assert_color_equal( context.color_map.color(0), [0.23003265, 0.29899933, 0.75400176, 1.]) testing.assert_color_equal( context.color_map.color(0.5), [0.86539042, 0.86541865, 0.86532601, 1.]) testing.assert_color_equal( context.color_map.color(1), [0.7059977, 0.01612647, 0.15000112, 1.]) testing.assert_color_equal( context.color_map.color(2), [0.7059977, 0.01612647, 0.15000112, 1.])
def step_impl(context): palette = toyplot.color.Palette([(1, 0, 0), (0, 1, 0), (0, 0, 1)]) color = iter(palette) testing.assert_color_equal(next(color), (1, 0, 0, 1)) testing.assert_color_equal(next(color), (0, 1, 0, 1)) testing.assert_color_equal(next(color), (0, 0, 1, 1)) with nose.tools.assert_raises(StopIteration): next(color)
def step_impl(context): palette = toyplot.color.Palette([(1, 0, 0), (0, 1, 0), (0, 0, 1)]) testing.assert_color_equal(palette[0], (1, 0, 0, 1)) testing.assert_color_equal(palette[1], (0, 1, 0, 1)) testing.assert_color_equal(palette[-1], (0, 0, 1, 1)) with nose.tools.assert_raises(IndexError): palette[3] with nose.tools.assert_raises(TypeError): palette[0:3]
def step_impl(context): colormap = toyplot.color.CategoricalMap( toyplot.color.Palette(["red", "lime", "blue", (1, 1, 1)])) testing.assert_color_equal(colormap.color(0), (1, 0, 0, 1)) testing.assert_color_equal(colormap.color(-1), (1, 1, 1, 1))
def step_impl(context): palette = toyplot.color.Palette([(1, 0, 0), (0, 1, 0), (0, 0, 1)]) testing.assert_color_equal(palette.color(0), (1, 0, 0, 1)) testing.assert_color_equal(palette.color(-1), (0, 0, 1, 1))
def step_impl(context): testing.assert_color_equal(context.color_map.color(-1), (1, 0, 0, 1)) testing.assert_color_equal(context.color_map.color(0), (1, 0, 0, 1)) testing.assert_color_equal(context.color_map.color(0.5), (0.5, 0, 0.5, 1)) testing.assert_color_equal(context.color_map.color(1), (0, 0, 1, 1)) testing.assert_color_equal(context.color_map.color(2), (0, 0, 1, 1))
def step_impl(context, value): testing.assert_color_equal(toyplot.color.css(context.value), eval(value))
def step_impl(context, value): testing.assert_color_equal( toyplot.color.css(context.value), eval(value))