Comments (3)
Interpolation with curves can produce out of gamut values due to curve overshoot. It is desirable to minimize this, and come curve interpolation methods have no overshoot.
This overview of interpolation mentions cosine interpolation, which is very straightforward code-wise and avoids the obvious discontinuities produced by linear interpolation, while having no overshoot:
from color.js.
compare
double LinearInterpolate(
double y1,double y2,
double mu)
{
return(y1*(1-mu)+y2*mu);
}
with
double CosineInterpolate(
double y1,double y2,
double mu)
{
double mu2;
mu2 = (1-cos(mu*PI))/2;
return(y1*(1-mu2)+y2*mu2);
}
from color.js.
Closing this since we already have non-linear-interpolation, and opened #410 to track shortcuts
from color.js.
Related Issues (20)
- [apps/picker] App is broken HOT 2
- Discord server for Color.js HOT 4
- [chore] Add core maintainers to footer
- Add error codes to all throws clauses
- [chore] Use typedoc for API docs HOT 1
- Avoid needless two-step color conversion at the start of gamut mapping HOT 2
- Ensure HSL is spec compliant HOT 3
- Live editing broken in docs HOT 16
- Should gamut mapping be done in the gamutSpace of a color space?
- (Some) nonstandard color spaces error when round-tripping HOT 4
- [chore] Separate website from library HOT 1
- New method: `deltas()` HOT 3
- How should angle coordinates be handled in nonstandard color spaces HOT 9
- Support `rec2100-linear`? HOT 1
- Docs: getAll(), setAll() HOT 2
- Docs: mapping of color space names - CSS space ids/function names, Color.js serialized, and Color.js space ids HOT 6
- Document `getAll()` and `setAll()` HOT 1
- Carrying forward analogous components in color interpolation HOT 5
- Gray color is not correctly cast to a string HOT 7
- New API to normalize color values without NaN. HOT 1
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.js.