Changing Colours Is Very Complicated

1 favourites
  • 9 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I spent many hours trying to figure out what I thought was a super simple task but I cannot manage to understand how the "Set colour" works on Construct. In the Manual, there is not much to figure out if it's a bug or needs to be done differently.

    Example:

    Manual says that we can use the

    ColorValue

    To set an object's colour to match another object.

    But it doesn't work for me

    ColorValue

    A number representing the color property of the instance. This can be used with the Set color action to set an object's color to match another object.

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-expressions

    C3 Demo:

    https://www.dropbox.com/s/uc09w48mrdbfkew/1-Color%20Bug.c3p?dl=0

    Also, when I tried to use the rgba255(145,88,31,255) directly it gives a different colour than I expected.

    Is there any simple way to change the colour by just giving the colour directly? like setting the colour to

    Brown >>>> rgba255(145,88,31,255)

    Without using any effects

    To get for example this color:

    I haven't tested the performance for when the Sprite Action "Set Color" is used but because is built in an Action Im hopping that works better than the Effects hopefully.

  • BG1 does not have any color in your example. so nothing to set to BG2.

    just make both sprites white, in the editor. and set the color of BG1 in the properties instead, to your brown color or whatever. then BG2 will get the color from BG1

  • The built-in color property for Sprites is basically a tint effect. It won't replace the image colors with the color you give it - instead it tints the existing colors with the color you give it (to be specific, it's a color multiply effect).

    If you really do want to replace all the image colors with another color, the 'Set color' effect can do that.

  • BG1 does not have any color in your example. so nothing to set to BG2.

    just make both sprites white, in the editor. and set the color of BG1 in the properties instead, to your brown color or whatever. then BG2 will get the color from BG1

    Hoh that was the issue then I was going crazy, I didn't know that there are two different departments (Animation Editor & Properties Panel) to set the colour as I assumed that BG1 was already brown which it was set from the Animation Editor instead. I would have never guessed this one on my own is very confusing as one would think that the Object is already Brown ))

    Though once you know how is working is ok. I would still include this important info on the manual as it would have saved me hours of looking like the "ColorValue" Action takes the colour from the "Left Editor Panel" and not from the "Animation Editor"

    Thanks a lot fredriksthlm that fixed the issue.

  • The built-in color property for Sprites is basically a tint effect. It won't replace the image colors with the color you give it - instead it tints the existing colors with the color you give it (to be specific, it's a color multiply effect).

    I see thanks for the Clarification, I assumed that the "Set Color" Action replaces the image colours, good to know.

    If you really do want to replace all the image colors with another color, the 'Set color' effect can do that.

    Cool thanks, I was looking for replacing the image colours so that will help, though I was looking for something that just replaces the color once to avoid effects to save on performance I will test it out and see. I try to avoid the effects as I just recently was testing the "BlackWhite" effect and the Old phones like iPhone7 it was dropping FPS to 50 just by dragging one object not sure why, I thought that was extreme and maybe a bug as it happens only on iPhone7.

    Will be cool to have something to read about how the effects work internally to have a general idea of how will impact the performance, example if I apply the "Set Color" effect will it be setting the colour every tick? or it just replaces the colour once and doesn't have to do any extra work after that which the performance impact will be minimal. Those kinds of info will be nice to know to make a proper choice of the Effect best suited for the job.

    Thanks a lot for the info.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The most cost effective method is set color, if the original sprite is pure white, or monochrome/greyscale, and the desired effect is just one color.

    Also the Tweens behavior has a setting to change colors, which is actually really cool.

  • The most cost effective method is set color, if the original sprite is pure white, or monochrome/greyscale, and the desired effect is just one color.

    Thanks Newt that some cool tips

    Is there any logic behind it?

    I'm guessing is because when is (White or grey) it doesn't have to mix Up colors and do more math

    Also the Tweens behavior has a setting to change colors, which is actually really cool.

    Nice! def is useful to do some cool effects

  • Is there any logic behind it?

    Multiply

    Looks at the color information in each channel and multiplies the base color by the blend color. The result color is always a darker color. Multiplying any color with black produces black. Multiplying any color with white leaves the color unchanged. When you’re painting with a color other than black or white, successive strokes with a painting tool produce progressively darker colors. The effect is similar to drawing on the image with multiple marking pens.

    (From Photoshop help)

  • Nice fredriksthlm

    That makes a lot of sense thanks for the info

    I think that sums up all, I already got all the info that I need from this thread to work out with the colors now just left to test and see what is the best performant etc...

    Thanks to everyone that contributed I appreciated ))

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)