02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table 6.1 Number of colours<br />

possible with different bit counts<br />

Bits Colours<br />

1 2<br />

4 16<br />

8 256<br />

12 4096<br />

16 65536<br />

24 16777216<br />

Chapter 6: Creating artwork for mobile devices<br />

Figure 6.5 Specifying a colour using hexadecimal<br />

Notice that a 24-bit device has over 16 million different possible colours while a 12-bit<br />

device has only just over 4000, rather than half of 16 million. But we are developing using<br />

a 24-bit environment, so how does this conversion occur? On a 24-bit machine there is 8bit<br />

resolution for the red, green and blue colours. See Chapter 12 for more information on<br />

how colours are specified. Eight bits gives a <strong>to</strong>tal of 256 different values for each channel.<br />

On a 12-bit device there is only 4-bit resolution per channel or 16 different options. When<br />

doing the conversion the bot<strong>to</strong>m four bits of each channel of the 24-bit image are effectively<br />

set <strong>to</strong> 0.<br />

Take a look at Figure 6.5, which shows the <strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> colour mixer dialog. In the<br />

bot<strong>to</strong>m left there is an input field where a colour can be specified using numbers and letters.<br />

This combination of numbers and letters is a hexadecimal representation. Each number or letter<br />

corresponds <strong>to</strong> 4 bits of data. The six different letters or numbers specify the 24-bit image using<br />

the following code ‘#RRGGBB’, starting from the left the first two are the red channel then the<br />

green and finally the blue. The numbers go in the following order 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F<br />

with F being the maximum possible value for 4 bits, i.e. the same as decimal 15. To move from<br />

24-bit colour space <strong>to</strong> a 12-bit colour space, every second value must be zero. As far as a 12-bit<br />

device is concerned, the colour #876543 is the same as #806040. Try entering some values in<br />

<strong>Flash</strong> and comparing the difference on a 24- or 32-bit moni<strong>to</strong>r. There is a significant difference.<br />

But the main place where the conversion will be noticeable is when using gradients. All gradients<br />

will appear significantly banded on a 12-bit machine. Take a look at Figure 6.6; here you can see<br />

a Nokia 3650 displaying a banded gradient and a smooth gradient.<br />

The smooth gradient was achieved by converting a 24-bit bitmap of the gradient <strong>to</strong> 12-bit using<br />

dithering. At this small size the dithering is not noticeable and is a suitable way of converting an<br />

image if a gradient is essential. You are advised, however, <strong>to</strong> avoid gradients where possible. You<br />

will also find that fades and transparency will affect the performance on the mobile device. Again<br />

it may be better <strong>to</strong> avoid alpha transparency and <strong>to</strong> reveal new content using wipes rather than<br />

fades.<br />

77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!