@kcuf/mere-color
Version:
Mere color utils for generating, manipulation, a11y purposes.
19 lines (18 loc) • 556 B
JavaScript
import { manipulateRgb, rgbMix } from '../util';
/**
* Tints a color by mixing it with white.
*
* `tint` can produce hue shifts, whereas `lighten` manipulates the luminance channel and therefore
* doesn't produce hue shifts.
*/
export default function tint(color) {
var percentage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
return manipulateRgb(color, function (rgb) {
return rgbMix(rgb, {
r: 255,
g: 255,
b: 255
}, [100 - percentage, percentage]);
});
}
//# sourceMappingURL=tint.js.map