Error on assigning color to SpriteRenderer

Well I’ve stuck with this problem for 2 hours and I’ll depend on the community now
(it’s not that I give up, but there’s still many things to code :p)
It’s an alchemist character, with the bottle she holds has [water/fluid/what u call it] that changes color between the selected 3 (there are 7 total). the [Water] is a .png with PURE WHITE/FFFFFF/255,255,255 color.
1639086--101527--$Capture.PNG

then… I play it.
1639086--101528--$Capture2.PNG1639086--101529--$Capture3.PNG
seems fine, but wait.
1639086--101530--$Capture4.PNG yellow = white?

knowing this bug, I try to go to inspector and change it manually.
1639086--101534--$err1.PNG
when I change to RED it goes VIOLET
when I change to GREEN it goes CYAN

FYI: only happens when its playing, when I stop its just normal.
So it must be something in Update(), but I’ve checked everywhere and the only one that change the color is its parent hierarchy (the bottle)

void Start()
{
     pot = this.transform.Find("pot").GetComponent<SpriteRenderer>();
     ChangeColor();
}

public void ChangeColor()
{
    pot.color = this.transform.root.GetComponent<Alchemist_Script>().color;
}

and there’s nothing wrong in Alchemist_Script. it doesn’t even have Update()

thanks. and sorry if this question is a bit stupid. :smile:

In your ChangeColor script try using Debug.Log to see what color gets returned from your Alchemist_Script.

aw damn I forgot to notify by email…
but thats not the problem… I’ve used the color variables for many other things and they’re just fine.
Now IVE FOUND the real problem here…

It looks like that the “B” value always locks at 255 when the game is running. Just that.
and it only applies to the potion sprite.
so BLACK(0,0,0) will always become BLUE(0,0,255)
GREEN(0,255,0) will always be CYAN(0,255,255)
and the alpha locks at 255 too.

I don’t find any problem in my script, and the other sprite renderer is just fine.

EDIT: just when I post this, the potion’s now fine when I play. it still bugs 5mins ago.
really… =="
I didn’t even do a thing