Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User mcr32's Avatar
    Join Date
    Jan 2004
    Posts
    2
    Does anyone know where I can find a visual reference for the 4096 colors?

  2. #2
    Regular Contributor remonvv's Avatar
    Join Date
    Mar 2003
    Location
    Rotterdam, Holland
    Posts
    118
    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
    remon@exmachina.nl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved