Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sprite.setColor Miscoloring  (Read 1395 times)

0 Members and 1 Guest are viewing this topic.

Oracular

  • Newbie
  • *
  • Posts: 2
    • View Profile
Sprite.setColor Miscoloring
« on: July 24, 2013, 01:04:06 am »
I'm attempting to replicate the effect of having a translucent color layer over a solid image in SFML. I have my base image which renders fine in SFML. In my image editor, I've tested numerous layers over the image to create various colored instances of the image. For example, the first red layer I've used has an RGBA value of 222, 14, 14, 128. When I use SFML's setColor method (using this same RGBA code) on the base image's sprite, the color of the end image is not the same. Am I misunderstanding the method's usage, or is this some bug? Is there a way I can get the same color my image editor gives me?

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Sprite.setColor Miscoloring
« Reply #1 on: July 24, 2013, 01:43:02 am »
The sprite color is multiplied with its texture color.
So if you want to "preview" the result in your graphics editor,  I guess you should set the mode of your color layer as "multiply". (for example in GIMP)