×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    18

    get colors from current theme and visible elements

    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
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: get colors from current theme and visible elements

    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
    Join Date
    Jul 2007
    Posts
    18

    Re: get colors from current theme and visible elements

    Many thanks! This was exactly what I searched for. Simple and effective.

  4. #4
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: get colors from current theme and visible elements

    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
  •  
×