UNPKG

@kcuf/mere-color

Version:

Mere color utils for generating, manipulation, a11y purposes.

15 lines 620 B
import _objectSpread from "@babel/runtime/helpers/objectSpread2"; import _clamp from 'lodash/clamp'; export default function rgbShiftAlpha(rgb, delta) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var _rgb$a = rgb.a, a = _rgb$a === void 0 ? 100 : _rgb$a; var _options$min = options.min, min = _options$min === void 0 ? 0 : _options$min, _options$max = options.max, max = _options$max === void 0 ? 100 : _options$max; return _objectSpread(_objectSpread({}, rgb), {}, { a: _clamp(a + delta, min, max) }); } //# sourceMappingURL=rgb-shift-alpha.js.map