UNPKG

@kcuf/mere-color

Version:

Mere color utils for generating, manipulation, a11y purposes.

17 lines (16 loc) 593 B
import { manipulateRgb, rgbShiftAlpha } from '../util'; /** * Decrease the transparency (or increase the opacity) of a color, making it more opaque. * * 参考 https://lesscss.org/functions/#color-operations-fadein */ export default function fadeIn(color) { var deltaAlpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; var max = arguments.length > 2 ? arguments[2] : undefined; return manipulateRgb(color, function (rgb) { return rgbShiftAlpha(rgb, deltaAlpha > 0 ? deltaAlpha : 0, { max: max }); }); } //# sourceMappingURL=fade-in.js.map