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

color.toString() not switching to rgba() with alpha change #92

Open
forresto opened this issue May 14, 2013 · 6 comments
Open

color.toString() not switching to rgba() with alpha change #92

forresto opened this issue May 14, 2013 · 6 comments
Milestone

Comments

@forresto
Copy link

Really nice library! Small bug:

When the initial value is a named or hex color, then alpha is changed, color.toString() doesn't switch to rgba() when needed.

http://jsfiddle.net/RsjFb/
screen shot 2013-05-15 at 12 05 44 am

@bgrins
Copy link
Owner

bgrins commented May 14, 2013

Thanks for the demo, I see the issue. So I am thinking the proposed change is if you call color.toString("hex") or color.toString("name") it should still return the hex / name value, but if you aren't passing any params those two should default to rgba instead.

@forresto
Copy link
Author

Yeah, I'd expect .toString() to return rgba when alpha < 1, otherwise match the original input's format.

@bgrins
Copy link
Owner

bgrins commented May 14, 2013

Added a test to Tinycolor for this, will look at implementation later. Spectrum is in sync with master on TinyColor so it should be an easy change.

@bgrins
Copy link
Owner

bgrins commented Jul 4, 2013

Added a commit to TinyColor to handle this case: bgrins/TinyColor@b65da21

bgrins added a commit that referenced this issue Jul 4, 2013
@bgrins
Copy link
Owner

bgrins commented Jul 4, 2013

@bgrins
Copy link
Owner

bgrins commented Jul 4, 2013

Copied code directly into jsfiddle: http://jsfiddle.net/RsjFb/1/

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