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

Improve color names to hex and vice versa #65

Closed
XhmikosR opened this issue Feb 10, 2013 · 14 comments
Closed

Improve color names to hex and vice versa #65

XhmikosR opened this issue Feb 10, 2013 · 14 comments
Assignees
Milestone

Comments

@XhmikosR
Copy link
Contributor

WhiteSmoke is bigger than #F5F5F5 and so on.

I suggest that most if not all of these colors are supported.

This might be a good starting point: https://github.com/stubbornella/csslint/blob/master/lib/parserlib.js#L943

@ghost ghost assigned GoalSmashers Feb 14, 2013
@GoalSmashers
Copy link
Contributor

I think we eventually should have it. Thanks for suggesting.

@nstepien
Copy link

It should also support translation from rgb()/hsl() to hex.
Also shorten #FFFFFF to #FFF for example.

hex.replace(/#([\da-fA-F])\1{5}/, '#$1$1$1');

@GoalSmashers
Copy link
Contributor

@MayhemYDG - we already do rgb -> hex and color shortening (see specs)! A (lengthy) list of all optimizations is coming soon - see #35.

@nstepien
Copy link

Oh all right then. Still missing hsl translation.

@GoalSmashers
Copy link
Contributor

We do hsl too - need that optimizations wiki page urgently :-)

@nstepien
Copy link

Uh? I use clean-css via grunt-contrib-cssmin and it's not translating hsl to hex.

@GoalSmashers
Copy link
Contributor

@MayhemYDG please check if you use grunt-contrib-cssmin 0.4.1+ as they only recently bumped clean-css dependency to 0.10.x (we added hsl support in 0.8.3).

@nstepien
Copy link

% npm install clean-css
% cat main.css | ../../../node_modules/clean-css/bin/cleancss -o test.css

  Usage: cleancss [options] <source-file>
  ...

This doesn't even seem to work?

../../../node_modules/clean-css/bin/cleancss main.css -o test.css

It doesn't translate hsl to hex, looks like the issue does come from clean-css.
I'm on the latest node, grunt and grunt-contrib-cssmin.

@GoalSmashers
Copy link
Contributor

@MayhemYDG - I was mistaken by another part of our code which handles HSL/HSLA cleanup. There's a ticket for HSL conversions now: #83.

@nstepien
Copy link

Great!

@GoalSmashers
Copy link
Contributor

@MayhemYDG - HSL conversions ready in 8cf8283.

@nstepien
Copy link

Good job.

@XhmikosR
Copy link
Contributor Author

Thanks! This was a much awaited feature. :)

@GoalSmashers
Copy link
Contributor

👍

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

3 participants