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

Added CoffeeScript + Javascript versions #26

Closed
wants to merge 1 commit into from

Conversation

dylan-baskind
Copy link

Great project!

I've been using these as the backing-data for a color selection palette in an Angular app, so I thought I'd save people the headache of converting the CSS / LESS / SASS to usable JSON.

Added a Coffeescript + VanillaJS version.

Hopefully useful to others.

D.

@ilanbiala
Copy link
Contributor

@dylan-baskind Nice idea, I actually think it could be really useful if you need to do some color stuff in JavaScript on the fly, but I think it could be a bit simpler. Take a look at the pull request I set up and let me know what you think. You can just call colors.aqua instead of having to do colors[0].name. It avoids the issue of having to memorize the order of the objects in the array and the code is more self-explanatory when anyone is reading it.

@dylan-baskind
Copy link
Author

Yo @ilanbiala - yah I'm with you!

Personally, I prefer accessing JS objects by property keys as well (i.e. colors.aqua) - makes much more sense to me; but most of my code-time these days is with Angular, which seems to work more smoothly iterating over arrays than objects; hence the more vanilla array version.

@mrmrs
Copy link
Owner

mrmrs commented Feb 27, 2014

@ilanbiala @dylan-baskind Thanks for bringing this up!
Is there value in having both? I could use a tokenizer to generate both of these formats from one source file if there is.

2 similar comments
@mrmrs
Copy link
Owner

mrmrs commented Feb 27, 2014

@ilanbiala @dylan-baskind Thanks for bringing this up!
Is there value in having both? I could use a tokenizer to generate both of these formats from one source file if there is.

@mrmrs
Copy link
Owner

mrmrs commented Feb 27, 2014

@ilanbiala @dylan-baskind Thanks for bringing this up!
Is there value in having both? I could use a tokenizer to generate both of these formats from one source file if there is.

@dylan-baskind
Copy link
Author

@mrmrs - No worries, pleasure to contribute --- my $0.02: @ilanbiala approach would be my preferred data-model format in any other scenario than Angular's ng-repeat iteration [but I think they might be addressing more palatable object iteration in future releases] - so I think best to go for @ilanbiala 's approach.

(PS. @mrmrs - how did no-one think of this before! The browser defaults / defaults in every other-email-text-app-ever are so horrendous. Kudos to you).

@mrmrs
Copy link
Owner

mrmrs commented Mar 3, 2014

@dylan-baskind - thanks a lot for the honest feedback. Going to close this pull request in favor of @ilanbiala's change. Definitely rock for bringing this up though.

1 similar comment
@mrmrs
Copy link
Owner

mrmrs commented Mar 3, 2014

@dylan-baskind - thanks a lot for the honest feedback. Going to close this pull request in favor of @ilanbiala's change. Definitely rock for bringing this up though.

@mrmrs mrmrs closed this Mar 3, 2014
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.

3 participants