Comments (18)
I'm guessing clone() method is not working properly.
from color.
Just a question of interest: Are you aware if usage of .clone()
give some performance over Color()
?
from color.
clone() use Color() :)
from color.
Btw, that's probably why it's buggy.
from color.
OK, thanks for reply..
from color.
@ZuBB can you create pull-request with failing tests?
from color.
Hi Vladimir!
I am very busy right now with my own stuff. If this can wait for a couple
of weeks then I will try to do it. Otherwise please assign this to other
person
On Jun 17, 2015 06:06, "Vladimir Starkov" [email protected] wrote:
@ZuBB https://github.com/ZuBB can you create pull-request with failing
tests?—
Reply to this email directly or view it on GitHub
#46 (comment).
from color.
okie
from color.
@ZuBB please, check 0.9 release. I fixed incorrect implementation
from color.
Closing for now, feel free to reopen if you still have issues.
from color.
I made a hacked build (due to other reasons) with new 'mix' method only and things become event worse
I did small investigation and found that mix method started to fail case that used to pass. see #61
from color.
@MoOx do you reopen this?
from color.
Hi @ZuBB, could you provide a few tests showing the break? If you provide them here I can clean them up and put them in myself.
from color.
I think the immutability PR fixes this. I used the test below. @ZuBB please advise if my test case is wrong. The test below fails on previous version.
describe('mixing bug works with immutable', function () {
it('mix produces proper color with clone or constructor or instance', function () {
var baseColor = Color('#73FF73');
var gtColor = Color('#FF7400');
var ltColor = Color('#004DFF');
[1, 2, 1.3, 1.4, 2.5, 4, 0.7, 8, 1.3].forEach(function (value) {
var otherColor = value > 1 ? gtColor : ltColor;
var weight = (value > 1 ? (value - 1) : (1 - value)) * 3;
var resultColor1 = baseColor.clone().mix(otherColor, weight);
var resultColor2 = Color('#73FF73').mix(otherColor, weight);
var resultColor3 = baseColor.mix(otherColor, weight);
deepEqual(resultColor1, resultColor2);
deepEqual(resultColor2, resultColor1);
deepEqual(resultColor1, resultColor3);
deepEqual(resultColor3, resultColor1);
deepEqual(resultColor2, resultColor3);
deepEqual(resultColor3, resultColor2);
});
});
});
from color.
Hi @wmira!
I do not have a chance to test/run your code but for me it looks it have to cover buggy case.
from color.
I'm having trouble with the mix()
function here
https://github.com/stevemao/color-transitions/blob/master/index.js#L38-L39
const color = color1.clone();
color.mix(color2, percent);
assume color1 is 'blue' and color2 is 'red', percent is 0.3
I was expecting it's 70% blue and 30% red, but it doesn't look like so.
from color.
Hey everyone. The cloning problem has been addressed in the rewrite (there is no .clone()
method anymore - you'll just pass another color). Hopefully this fixes all of these problems. 💃
Any new issues should be opened as a new bug since it pertains to the rewrite.
from color.
Closing this since I believe this is fixed. Please let me know if that's not the case!
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.