tags:

views:

25

answers:

1

Why does the following code

Graphics[Raster[{{Hue[1], Hue[1/3]}, {Hue[2/3], Hue[1/6]}}]]

not produce any output? In Mathematica < 6 RasterArray was able to handle this and produced the same output as

Graphics[Raster[{{{1, 0, 0}, {0, 1, 0}}, {{0, 0, 1}, {1, 1, 0}}}]]
+3  A: 

The documentation of Raster indicates that its arguments are not graphics directives (e.g. Hue, RGBColor) but rather numbers - a gray level (single number), RGB values (three numbers), RGBalpha values (four numbers), or gray-alpha values (two numbers). However, it provides the ability to instead specify the color function yourself, for example:

Graphics[Raster[{{0, 0.2, 0.4}, {0.6, 0.8, 1}}, ColorFunction -> Hue]]

(straight from the documentation for v6)

Jefromi