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

Expose rgba properties of Color #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stillwaiting
Copy link

Hi! First, thank you very much for all your hard work. I've used your wrapper for my key component (puzzle engine) in my pet project: gamified pomodoro-like timer puzzle25.com.

However, I badly needed these properties to check wether the mouse is over the puzzle or over some empty space, therefore added these. Wondering if this could go upstream as they are available in the JS version of paper.js.

Thanks.

@yoeluk
Copy link
Owner

yoeluk commented Oct 5, 2016

No problems. Thanks for your PR! I'm wondering why in specific you need the var parameters? Wouldn't it be better to return a new colour via the copy or apply methods?
myColour.copy(red = ...)

@stillwaiting
Copy link
Author

In paper.js I can do things like:

if (circle.fillColor.alpha > 0.5) {
    circle.fillColor.alpha = 0.1;  
}

so, this is kind of functionality I was missing. But I see you point, let me play with it some more. Thanks.

@stillwaiting
Copy link
Author

stillwaiting commented Oct 11, 2016

Sorry for the long reply, hard week. Yep, you are right, I can always create the new object, so only read access is required. Amended. @yoeluk, would you please have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants