Comments (22)
👍
PRs are welcome ;)
from color.
I would prefer an immutable, functional style too. In fact, without looking at the docs, that was how I started to use color
and it didn't work! :-P
I would be willing to work on a PR for this, but it would break everyone's existing code, which is not advisable.
A few options:
- Add a function that selects immutable mode or mutable mode, but default to the current mutable behavior if that function is not called. This keeps compatibility, but adds overhead to every mutative function to check the flag and the extra code in the
if/else
bodies. - Go ahead and break compatibility, but do a major version number bump so that most
package.json
files won't update automatically. Provide a section in the README with upgrade instructions. - Start with option 1 and then move to option 2 in the near future.
- Fork the project and make the changes there.
Thoughts?
from color.
but it would break everyone's existing code, which is not advisable.
1.0 didn't exist yet, so we don't care. This project is sort of unmaintained. I am open to lead it (since I have the right for it) but didn't have too much time lately (busy with cssnext, stylelint...).
So please make a PR that break the current API. Major bump with a proper CHANGELOG that contains way to upgrade will do the trick.
from color.
I see. What do you mean by "since I have the right for it"? Is there a word missing there or are you referring to license rights?
from color.
The original author add me as a collaborator for this repo, so I can push, merge (& even push on npm).
from color.
T+1 to this, it was really odd to discover that it is mutable
from color.
this just bit me, i was writing some tests then it hit me... its mutable :( +1 for this pr please
from color.
Feel free to make the PR.
from color.
I am going to release this breaking change in 1.0 asap.
from color.
@MoOx does that mean you handled this? Or does this still need to happen?
from color.
I started to work on it, but I didn't finish. Too much work according to the time I allowed me to handle it :)
from color.
I did a stab at this. I'm still not familiar with some parts of the code but it probably can be used as basis for the actual change. I don't think I have broken anything -- tests still works etc.
from color.
https://github.com/facebook/immutable-js could help?
from color.
@kevinSuttle It won't. I'll try to submit a patch.
from color.
NVM #77 achieves it.
from color.
Woot
from color.
Going to keep this open until #77 is merged. Thanks @ooflorent 👍
from color.
Before this is closed, the README should be updated. The first example mutates a color. I'm willing to update the example if a more extensive update of the README isn't being worked on.
from color.
Agreed, though I'm working on a makeover branch right now that will have all of that included. You're welcome to submit a PR for the readme for the time being, though.
from color.
Just started to use color
in our project and have already been bitten by this. :/
I see #77 was reverted. Any plans on still doing this?
from color.
@igl Yes - version 1 will definitely be immutable.
I should probably get to it soon. Every time I sit down to bang out the v1 rewrite it turns into a multi-day thing that ultimately goes by the wayside. I'll dedicate some time to this soon.
from color.
I came here to request the same, but offer help & support.
A work project is dependent on color
so I'd be interested in helping out to get v1 out the door with any BC changes in this milestone & punting on feature additions:
from color.
Related Issues (20)
- Error on function isLight() and isDark()
- Fix luminosity by removing underscore
- node_modules/color/index.js: Unexpected token: name (_28) in file node_modules/color/index.js at 236:30. HOT 1
- How to resolve React: Module parse failed: Identifier directly after number (numberic separator) HOT 1
- "Error: Unable to parse color from string: #10b981" HOT 1
- [BUG] `hex` method discards alpha HOT 3
- Invalid value input is not handled properly HOT 2
- Need help to update the @types/color definitions HOT 4
- Can't bundle js for react-native project
- `.hex()` silently drops alpha info. HOT 1
- Please just add to README about using v3 instead of v4 on unsupported envs HOT 3
- React native BUILD FAILED using [email protected]
- Relative Luminance equation HOT 1
- Bug in alpha handling during model conversions HOT 1
- ma.js HOT 1
- 🏳️🌈
- React Native is back! Thank's for listen to us! HOT 1
- Provide esm version / exports HOT 12
- Unable to parse RGBA no comma alpha value in percentage. HOT 4
- @types/color outdated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from color.