Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User kawan95's Avatar
    Join Date
    Jul 2007
    Posts
    18
    Is it possible to get the color code from elements on the screen? Or can I get the codes directly out of the current theme?

    I want to draw on canvas and use the same colors that are used by the current theme. For example buttons, background, text and a scrollbar shall be drawn in the same color that is used by the current theme.

    One possibility would perhaps be to take a copy of the current canvas, save it into a file an reread the file an its content. But: This seems to be a bit complicated.

    Is there an easy way to do this? Perhaps something like "get_color_at(x,y)"?

  2. #2
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    Well I think you can take a screenshot and analyze certain parts of it to determine what colour the theme uses (you use Image.getpixel((x,y)) for that). You can't read information about the theme (like colours) in Python unless you write a C++ extension for it.

  3. #3
    Registered User kawan95's Avatar
    Join Date
    Jul 2007
    Posts
    18
    Many thanks! This was exactly what I searched for. Simple and effective.

  4. #4
    Nokia Developer Champion marcelobarrosalmeida's Avatar
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    752
    Quote Originally Posted by bogdan.galiceanu View Post
    Well I think you can take a screenshot and analyze certain parts of it to determine what colour the theme uses (you use Image.getpixel((x,y)) for that).
    wow, great ! I like this workaround

Similar Threads

  1. Replies: 1
    Last Post: 2009-05-16, 10:30

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