UNPKG

@kcuf/mere-color

Version:

Mere color utils for generating, manipulation, a11y purposes.

16 lines (15 loc) 436 B
import _objectSpread from "@babel/runtime/helpers/objectSpread2"; import { manipulateRgb } from '../util'; /** * Set the absolute opacity of a color. * * 参考 https://lesscss.org/functions/#color-operations-fade */ export default function fade(color, toAlpha) { return manipulateRgb(color, function (rgb) { return _objectSpread(_objectSpread({}, rgb), {}, { a: toAlpha }); }); } //# sourceMappingURL=fade.js.map