Where do I find the colour settings of the theme? [answered]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
fluxus
Regular
Posts: 133
Joined: Thu Jun 19, 2014 8:06 am
Projects: Animal Anaesthesia (a teaching game)
Contact:

Where do I find the colour settings of the theme? [answered]

#1 Post by fluxus »

Hello, this is sort of simple to solve manually, but it bugs me.
So I'm yet again hoping for help from kind strangers :]

First off, the theme sets some colour values in options.rpy through use of a theme function.
I can pretty easily copy-paste the colour from there to script, but.. if I change the theme afterwards things will get pretty awkward.

Some old documentation claims there's a style hierarchy to be found, but it doesn't seem to be present now.
The colour I want is the colour the frames get, so one would think style.frame.background would get it for me..
..unfortunately whatever this value is, it's apparently not a colour.

I found out the developer console will give me things if asked nicely. 'dir(theme)' lets me know that, yes, there's a theme object actually.
Unfortunately I don't know if it has colour attributes, or if so, where they're found.
I could write a python function to traverse an arbitrary object, but it'd be somewhat easier to look at source code or obscure documentation, if someone knows where it is to be found.

I'm probably missing something obvious? :]
Last edited by fluxus on Tue Aug 26, 2014 5:29 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Where do I find the colour settings of the theme?

#2 Post by PyTom »

You can figure out what styles are being used by using the style inspector. Hover over a displayable, and hit shift+I (as in Iris.) That will display the displayables at that point. Click on one to see all the styles it uses.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
fluxus
Regular
Posts: 133
Joined: Thu Jun 19, 2014 8:06 am
Projects: Animal Anaesthesia (a teaching game)
Contact:

Re: Where do I find the colour settings of the theme?

#3 Post by fluxus »

Okay, thanks.. I wanted to do it from code, though.

The idea was to define the colours on a drag-drop object in the same style as whatever the current theme was using.
For that to work, I needed to find the current colour scheme of the theme, but that turned out to be pretty complicated.

By the way.. For some reason my post have been duplicated, it seems. Perhaps during editing.
In any case, xela has been helping out :]

Link to other post

Post Reply

Who is online

Users browsing this forum: Google [Bot], Nozori_Games