×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    17

    Get the color value for Display.COLOR_BACKGROUND

    Hi,
    i am trying to get the RGB values of Display.COLOR_BACKGROUND or Display.COLOR_FOREGROUND. Is there a way i can obtain the values. When i use System.out i get the values as color0 and color1 but is there way i can get the RGB values.
    Thanks and Regards,
    Abhijeeth

  2. #2
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    Re: Get the color value for Display.COLOR_BACKGROUND

    You are getting only color specifiers (Display.COLOR_BACKGROUND).

    Probably you want to use Display.getColor(Display.COLOR_BACKGROUND).

    Br.
    P.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    17

    Re: Get the color value for Display.COLOR_BACKGROUND

    It just return as 2 for highlighted background and 1 for background color.

  4. #4
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    Re: Get the color value for Display.COLOR_BACKGROUND

    Well, it is working for me - at least I tried this on emulator (S40 6th ed FP1).

    I tried this code:
    Code:
    Display display = Display.getDisplay(midlet);
    System.out.println("background: " + display.getColor(Display.COLOR_BACKGROUND));
    System.out.println("border: " + display.getColor(Display.COLOR_BORDER));
    System.out.println("foreground: " + display.getColor(Display.COLOR_FOREGROUND));
    System.out.println("highlighted background: " + display.getColor(Display.COLOR_HIGHLIGHTED_BACKGROUND));
    System.out.println("highlighted border: " + display.getColor(Display.COLOR_HIGHLIGHTED_BORDER));
    System.out.println("highlighted foreground: " + display.getColor(Display.COLOR_HIGHLIGHTED_FOREGROUND));
    and the result is:
    Code:
    background: 16777215
    border: 16777215
    foreground: 0
    highlighted background: 9291505
    highlighted border: 9291505
    highlighted foreground: 16777215

  5. #5
    Registered User
    Join Date
    Dec 2010
    Posts
    17

    Re: Get the color value for Display.COLOR_BACKGROUND

    Ok thanks let me verify it on that emulator ;-)

Similar Threads

  1. Color display simulator
    By pundkarnilesh in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2010-02-19, 06:21
  2. 7600??? 65000 color display...
    By manjax in forum Mobile Java General
    Replies: 0
    Last Post: 2005-06-29, 02:44
  3. Color image display compatibility on all mobiles!
    By SKIL in forum Browsing and Mark-ups
    Replies: 2
    Last Post: 2004-09-28, 07:16
  4. Replies: 2
    Last Post: 2003-08-07, 12:58

Posting Permissions

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