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

Fixed alpha channel may make the gem useless for some purposes #14

Open
grv87 opened this issue Oct 12, 2014 · 2 comments
Open

Fixed alpha channel may make the gem useless for some purposes #14

grv87 opened this issue Oct 12, 2014 · 2 comments

Comments

@grv87
Copy link

grv87 commented Oct 12, 2014

At this moment all the colors have fixed alpha channel. This makes the gem useless for some purposes (i.e. CSS). What is a reason to have css_rgba if it anyway substitutes 1 for alpha?

I started to add alpha channels to RGB and other classes, but there is one problem, so I want to ask first.
Is it OK if initialize functions will change its parameters? For example, for RGB:

  def initialize(r = 0, g = 0, b = 0, a = nil, radix = 255.0, &block) # :yields self:

Code depending on radix parameter will have to be updated then. Considering that color-2 is in development, I think that it's OK.

Another approach is to create separate classes RGBA and so on. Since alpha channel can be applied to each color model, it is questionable way.

What do you think or plan?

@halostatue
Copy link
Owner

For different reasons, I am going to be releasing one more Color 1.x release and then I hope to get back to color-2 in the new year. When I move that direction, I am probably moving toward making it support Ruby 2 only especially for new parameters so as to support keyword arguments.

@halostatue
Copy link
Owner

This has been partially resolved by allowing css_rgba to accept an optional alpha parameter (defaulting to 1) in the just-release 1.8.

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

No branches or pull requests

2 participants