Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2004

    4096 Color Palette

    Does anyone know where I can find a visual reference for the 4096 colors?

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Rotterdam, Holland
    The 4096 colors supported on devices are not an indexed palette but a direct color model. As such, each color component (R, G, B) is represented by 4 bits (0-15). To check if a color is displayed as it will be on devices with 4096 colors use :

    boolean valid = (color & 0x0f0f0f) == 0;

    if valid is false, the four least significant bits of the color specified were non-zero, and the color will be truncated upon display (which usually isnt a problem since it'll simply mean the color will be displayed as if the least significant bits were zero). Also, if you use Sun's WTK 1.X, be aware that the dithering performed in those emulators is not an accureate representation of how it will look on phones. I have yet to run into a MIDP device that dithers instead of truncating the color components as described above.

    Remon van Vliet
    Ex Machina

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts