Can I have Renpy change specific colors to a specific palette?

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
GraymatterSandvich
Newbie
Posts: 1
Joined: Sat Mar 23, 2024 5:31 pm
Contact:

Can I have Renpy change specific colors to a specific palette?

#1 Post by GraymatterSandvich »

I'm not sure if I worded that correctly, but basically I want to Renpy look for specific colors, and change them to a different one based on the users choice. What I'm working on is pixel art, so it doesn't have a gigantic palette of blurry colors to have to change, just, like, five.

The goal would be that the user could, say, choose between pink hair and blue hair. If the user chooses blue hair, the game automatically changes any picture with the hex code #FF00DC (A bright obnoxious pink), and changes it into #66BFFF (A light, sky blue). It would also have a few other colors for the highlights and darker parts of the hair. Is this at all possible or is there a different way to go about this? I'm sorta new to coding with Renpy, so I don't really know how to do this (or if it's even possible).

Basically, something like this.
Image

jeffster
Veteran
Posts: 409
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Can I have Renpy change specific colors to a specific palette?

#2 Post by jeffster »

1. Ren'Py has simple tools to re-color images, e.g. with different tints:
https://renpy.org/doc/html/matrixcolor.html

But with that method I don't know how to replace only a few specific colors without affecting other colors.

2. However it is possible to split images into parts and affect only some of those parts.
To show images consisting of several parts, see e.g. "layered image":
https://renpy.org/doc/html/layeredimage.html
or "Composite":
https://renpy.org/doc/html/displayables.html#Composite
For example, if there is a set of different wigs, a character can be shown with any of them.

3. In such cases developers often use pre-made pics rather than recolor them at runtime.

4. Changing individual colors can be possible using shaders.
(I've no idea what I'm talking about).
See "Model-Based Rendering"
https://renpy.org/doc/html/model.html

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Milkymalk, wizard_jpg