Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting colorRGBA does not set alpha #1363

Open
Birkemose opened this issue Mar 6, 2016 · 5 comments
Open

Setting colorRGBA does not set alpha #1363

Birkemose opened this issue Mar 6, 2016 · 5 comments
Labels

Comments

@Birkemose
Copy link
Contributor

Setting colorRGBA on CCNodeColor does not set color correctly, unless cascade opacity is enabled.

@s1ddok
Copy link
Contributor

s1ddok commented Mar 6, 2016

I honestly don't really understand why color and colorRGBA are separated. Maybe for cascading purposes, I didn't look into that yet. Will see what we can do about it.

@s1ddok
Copy link
Contributor

s1ddok commented Mar 6, 2016

I also don't understand why we still maintain types like ccColor4F. The whole color things must be refactored I guess.

@s1ddok s1ddok closed this as completed Mar 6, 2016
@s1ddok s1ddok reopened this Mar 6, 2016
@richardgroves
Copy link
Contributor

The ccColor4F guff was due to die in 4.0 wasn't it?. Suspect it was considered too much of (another) major back compatibility break during the 2.x to 3.x process. Pain though isn't it?

The whole cascade colour/opacity has some serious issues as well. Will try and dig them out and file issues/PRs now this is active again.

@Birkemose
Copy link
Contributor Author

CCColor was created to bridge all the different color types. Personally I voted that it should be a simple struct (and work more like CGPoint), and I have always hated that CCColor is immutable.

color just sets the color, and not opacity. This is how cocos2d always worked. colorRGBA was added to be able to set a color including opacity.

As mentioned, the cascade functionality has some issues, like the one I just reported.

@s1ddok
Copy link
Contributor

s1ddok commented Mar 6, 2016

Making it a struct would be much better, but Obj-C doesn't have methods for structs as Swift has :(

@s1ddok s1ddok added the Bug label Mar 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants