@dxyl/utils 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +6590 -6259
- package/dist/index.umd.js +20 -71
- package/lib/glslang/glslang.d.ts +14 -14
- package/lib/glslang/glslang.js +112 -112
- package/lib/twgsl/twgsl.js +53 -53
- package/package.json +51 -51
- package/types/color/blend/helpers.d.ts +32 -0
- package/types/color/blend/index.d.ts +129 -0
- package/types/color/blend/non-separable-blend.d.ts +9 -0
- package/types/color/blend/non-separable-modes.d.ts +33 -0
- package/types/color/blend/separable-blend.d.ts +9 -0
- package/types/color/blend/separable-modes.d.ts +100 -0
- package/types/color/blend/types.d.ts +38 -0
- package/types/color/blend/unit.d.ts +129 -0
- package/types/color/composite/composite-core.d.ts +34 -0
- package/types/color/composite/composite-types.d.ts +10 -0
- package/types/color/composite/image-data-compositor.d.ts +5 -0
- package/types/color/composite/webgl-compositor.d.ts +10 -0
- package/types/color/composite/webgpu-compositor.d.ts +10 -0
- package/types/data/immer.d.ts +262 -262
- package/types/data/immutable.d.ts +5127 -5127
- package/types/data/mobx.d.ts +2 -2
- package/types/events/event_emiter.d.ts +43 -43
- package/types/fast-deep-equal.d.ts +1 -1
- package/types/index.d.ts +3 -0
- package/types/lodash/add.d.ts +1 -2
- package/types/lodash/after.d.ts +1 -2
- package/types/lodash/array.d.ts +1 -3
- package/types/lodash/array.default.d.ts +68 -70
- package/types/lodash/ary.d.ts +1 -2
- package/types/lodash/assign.d.ts +1 -2
- package/types/lodash/assignIn.d.ts +1 -2
- package/types/lodash/assignInWith.d.ts +1 -2
- package/types/lodash/assignWith.d.ts +1 -2
- package/types/lodash/at.d.ts +1 -2
- package/types/lodash/attempt.d.ts +1 -2
- package/types/lodash/augment.d.ts +2 -2
- package/types/lodash/before.d.ts +1 -2
- package/types/lodash/bind.d.ts +1 -2
- package/types/lodash/bindAll.d.ts +1 -2
- package/types/lodash/bindKey.d.ts +1 -2
- package/types/lodash/cache.d.ts +14 -14
- package/types/lodash/camelCase.d.ts +1 -2
- package/types/lodash/capitalize.d.ts +1 -2
- package/types/lodash/castArray.d.ts +1 -2
- package/types/lodash/ceil.d.ts +1 -2
- package/types/lodash/chain.d.ts +1 -2
- package/types/lodash/chunk.d.ts +1 -2
- package/types/lodash/clamp.d.ts +1 -2
- package/types/lodash/clear-animation-frame.d.ts +1 -1
- package/types/lodash/clone.d.ts +1 -2
- package/types/lodash/cloneDeep.d.ts +1 -2
- package/types/lodash/cloneDeepWith.d.ts +1 -2
- package/types/lodash/cloneWith.d.ts +1 -2
- package/types/lodash/collection.d.ts +1 -3
- package/types/lodash/collection.default.d.ts +31 -33
- package/types/lodash/compact.d.ts +1 -2
- package/types/lodash/concat.d.ts +1 -2
- package/types/lodash/cond.d.ts +1 -2
- package/types/lodash/conforms.d.ts +1 -2
- package/types/lodash/conformsTo.d.ts +1 -2
- package/types/lodash/constant.d.ts +1 -2
- package/types/lodash/contains.d.ts +2 -2
- package/types/lodash/countBy.d.ts +1 -2
- package/types/lodash/create.d.ts +1 -2
- package/types/lodash/curry.d.ts +1 -2
- package/types/lodash/curryRight.d.ts +1 -2
- package/types/lodash/date.d.ts +1 -3
- package/types/lodash/date.default.d.ts +4 -6
- package/types/lodash/debounce.d.ts +2 -4
- package/types/lodash/deburr.d.ts +1 -2
- package/types/lodash/deep-mix.d.ts +2 -2
- package/types/lodash/defaultTo.d.ts +1 -2
- package/types/lodash/defaults.d.ts +1 -2
- package/types/lodash/defaultsDeep.d.ts +1 -2
- package/types/lodash/defer.d.ts +1 -2
- package/types/lodash/delay.d.ts +1 -2
- package/types/lodash/difference.d.ts +1 -2
- package/types/lodash/differenceBy.d.ts +1 -2
- package/types/lodash/differenceWith.d.ts +1 -2
- package/types/lodash/divide.d.ts +1 -2
- package/types/lodash/drop.d.ts +1 -2
- package/types/lodash/dropRight.d.ts +1 -2
- package/types/lodash/dropRightWhile.d.ts +1 -2
- package/types/lodash/dropWhile.d.ts +1 -2
- package/types/lodash/each.d.ts +1 -2
- package/types/lodash/eachRight.d.ts +1 -2
- package/types/lodash/ends-with.d.ts +3 -3
- package/types/lodash/endsWith.d.ts +1 -2
- package/types/lodash/entries.d.ts +1 -2
- package/types/lodash/entriesIn.d.ts +1 -2
- package/types/lodash/eq.d.ts +1 -2
- package/types/lodash/escape.d.ts +1 -2
- package/types/lodash/escapeRegExp.d.ts +1 -2
- package/types/lodash/every.d.ts +1 -2
- package/types/lodash/extend.d.ts +1 -2
- package/types/lodash/extendWith.d.ts +1 -2
- package/types/lodash/fill.d.ts +1 -2
- package/types/lodash/filter.d.ts +1 -2
- package/types/lodash/find-index.d.ts +2 -2
- package/types/lodash/find.d.ts +1 -2
- package/types/lodash/findIndex.d.ts +1 -2
- package/types/lodash/findKey.d.ts +1 -2
- package/types/lodash/findLast.d.ts +1 -2
- package/types/lodash/findLastIndex.d.ts +1 -2
- package/types/lodash/findLastKey.d.ts +1 -2
- package/types/lodash/first-value.d.ts +2 -2
- package/types/lodash/first.d.ts +1 -2
- package/types/lodash/fixed-base.d.ts +2 -2
- package/types/lodash/flatMap.d.ts +1 -2
- package/types/lodash/flatMapDeep.d.ts +1 -2
- package/types/lodash/flatMapDepth.d.ts +1 -2
- package/types/lodash/flatten-deep.d.ts +12 -12
- package/types/lodash/flatten.d.ts +1 -2
- package/types/lodash/flattenDeep.d.ts +1 -2
- package/types/lodash/flattenDepth.d.ts +1 -2
- package/types/lodash/flip.d.ts +1 -2
- package/types/lodash/floor.d.ts +1 -2
- package/types/lodash/flow.d.ts +1 -2
- package/types/lodash/flowRight.d.ts +1 -2
- package/types/lodash/for-in.d.ts +2 -2
- package/types/lodash/forEach.d.ts +1 -2
- package/types/lodash/forEachRight.d.ts +1 -2
- package/types/lodash/forIn.d.ts +1 -2
- package/types/lodash/forInRight.d.ts +1 -2
- package/types/lodash/forOwn.d.ts +1 -2
- package/types/lodash/forOwnRight.d.ts +1 -2
- package/types/lodash/fromPairs.d.ts +1 -2
- package/types/lodash/function.d.ts +1 -3
- package/types/lodash/function.default.d.ts +26 -28
- package/types/lodash/functions.d.ts +1 -2
- package/types/lodash/functionsIn.d.ts +1 -2
- package/types/lodash/get-range.d.ts +6 -6
- package/types/lodash/get-type.d.ts +2 -2
- package/types/lodash/get-wrap-behavior.d.ts +9 -9
- package/types/lodash/get.d.ts +1 -2
- package/types/lodash/group-by.d.ts +6 -6
- package/types/lodash/group-to-map.d.ts +8 -8
- package/types/lodash/group.d.ts +2 -2
- package/types/lodash/groupBy.d.ts +1 -2
- package/types/lodash/gt.d.ts +1 -2
- package/types/lodash/gte.d.ts +1 -2
- package/types/lodash/has-key.d.ts +2 -2
- package/types/lodash/has-value.d.ts +2 -2
- package/types/lodash/has.d.ts +1 -2
- package/types/lodash/hasIn.d.ts +1 -2
- package/types/lodash/head.d.ts +1 -2
- package/types/lodash/identity.d.ts +1 -2
- package/types/lodash/inRange.d.ts +1 -2
- package/types/lodash/includes.d.ts +1 -2
- package/types/lodash/index-of.d.ts +2 -2
- package/types/lodash/index.d.ts +304 -304
- package/types/lodash/indexOf.d.ts +1 -2
- package/types/lodash/initial.d.ts +1 -2
- package/types/lodash/intersection.d.ts +1 -2
- package/types/lodash/intersectionBy.d.ts +1 -2
- package/types/lodash/intersectionWith.d.ts +1 -2
- package/types/lodash/invert.d.ts +1 -2
- package/types/lodash/invertBy.d.ts +1 -2
- package/types/lodash/invoke.d.ts +1 -2
- package/types/lodash/invokeMap.d.ts +1 -2
- package/types/lodash/is-arguments.d.ts +2 -2
- package/types/lodash/is-array-like.d.ts +2 -2
- package/types/lodash/is-array.d.ts +2 -2
- package/types/lodash/is-boolean.d.ts +2 -2
- package/types/lodash/is-date.d.ts +2 -2
- package/types/lodash/is-decimal.d.ts +2 -2
- package/types/lodash/is-element.d.ts +6 -6
- package/types/lodash/is-empty.d.ts +2 -2
- package/types/lodash/is-equal-with.d.ts +24 -24
- package/types/lodash/is-equal.d.ts +2 -2
- package/types/lodash/is-error.d.ts +2 -2
- package/types/lodash/is-even.d.ts +2 -2
- package/types/lodash/is-finite.d.ts +1 -1
- package/types/lodash/is-function.d.ts +2 -2
- package/types/lodash/is-integer.d.ts +2 -2
- package/types/lodash/is-match.d.ts +2 -2
- package/types/lodash/is-negative.d.ts +2 -2
- package/types/lodash/is-nil.d.ts +2 -2
- package/types/lodash/is-null.d.ts +2 -2
- package/types/lodash/is-number-equal.d.ts +1 -1
- package/types/lodash/is-number.d.ts +2 -2
- package/types/lodash/is-object-like.d.ts +2 -2
- package/types/lodash/is-object.d.ts +2 -2
- package/types/lodash/is-odd.d.ts +2 -2
- package/types/lodash/is-plain-object.d.ts +2 -2
- package/types/lodash/is-positive.d.ts +2 -2
- package/types/lodash/is-prototype.d.ts +2 -2
- package/types/lodash/is-reg-exp.d.ts +2 -2
- package/types/lodash/is-segment-equal.d.ts +2 -2
- package/types/lodash/is-string.d.ts +2 -2
- package/types/lodash/is-type.d.ts +2 -2
- package/types/lodash/is-undefined.d.ts +2 -2
- package/types/lodash/isArguments.d.ts +1 -2
- package/types/lodash/isArray.d.ts +1 -2
- package/types/lodash/isArrayBuffer.d.ts +1 -2
- package/types/lodash/isArrayLike.d.ts +1 -2
- package/types/lodash/isArrayLikeObject.d.ts +1 -2
- package/types/lodash/isBoolean.d.ts +1 -2
- package/types/lodash/isBuffer.d.ts +1 -2
- package/types/lodash/isDate.d.ts +1 -2
- package/types/lodash/isElement.d.ts +1 -2
- package/types/lodash/isEmpty.d.ts +1 -2
- package/types/lodash/isEqual.d.ts +1 -2
- package/types/lodash/isEqualWith.d.ts +1 -2
- package/types/lodash/isError.d.ts +1 -2
- package/types/lodash/isFinite.d.ts +1 -2
- package/types/lodash/isFunction.d.ts +1 -2
- package/types/lodash/isInteger.d.ts +1 -2
- package/types/lodash/isLength.d.ts +1 -2
- package/types/lodash/isMap.d.ts +1 -2
- package/types/lodash/isMatch.d.ts +1 -2
- package/types/lodash/isMatchWith.d.ts +1 -2
- package/types/lodash/isNaN.d.ts +1 -2
- package/types/lodash/isNative.d.ts +1 -2
- package/types/lodash/isNil.d.ts +1 -2
- package/types/lodash/isNull.d.ts +1 -2
- package/types/lodash/isNumber.d.ts +1 -2
- package/types/lodash/isObject.d.ts +1 -2
- package/types/lodash/isObjectLike.d.ts +1 -2
- package/types/lodash/isPlainObject.d.ts +1 -2
- package/types/lodash/isRegExp.d.ts +1 -2
- package/types/lodash/isSafeInteger.d.ts +1 -2
- package/types/lodash/isSet.d.ts +1 -2
- package/types/lodash/isString.d.ts +1 -2
- package/types/lodash/isSymbol.d.ts +1 -2
- package/types/lodash/isTypedArray.d.ts +1 -2
- package/types/lodash/isUndefined.d.ts +1 -2
- package/types/lodash/isWeakMap.d.ts +1 -2
- package/types/lodash/isWeakSet.d.ts +1 -2
- package/types/lodash/iteratee.d.ts +1 -2
- package/types/lodash/join.d.ts +1 -2
- package/types/lodash/kebabCase.d.ts +1 -2
- package/types/lodash/keyBy.d.ts +1 -2
- package/types/lodash/keys.d.ts +1 -2
- package/types/lodash/keysIn.d.ts +1 -2
- package/types/lodash/lang.d.ts +1 -3
- package/types/lodash/lang.default.d.ts +59 -61
- package/types/lodash/last.d.ts +1 -2
- package/types/lodash/lastIndexOf.d.ts +1 -2
- package/types/lodash/lower-case.d.ts +2 -2
- package/types/lodash/lower-first.d.ts +2 -2
- package/types/lodash/lowerCase.d.ts +1 -2
- package/types/lodash/lowerFirst.d.ts +1 -2
- package/types/lodash/lt.d.ts +1 -2
- package/types/lodash/lte.d.ts +1 -2
- package/types/lodash/map-values.d.ts +6 -6
- package/types/lodash/map.d.ts +1 -2
- package/types/lodash/mapKeys.d.ts +1 -2
- package/types/lodash/mapValues.d.ts +1 -2
- package/types/lodash/matches.d.ts +1 -2
- package/types/lodash/matchesProperty.d.ts +1 -2
- package/types/lodash/math.d.ts +1 -3
- package/types/lodash/math.default.d.ts +18 -20
- package/types/lodash/max-by.d.ts +16 -16
- package/types/lodash/max.d.ts +1 -2
- package/types/lodash/maxBy.d.ts +1 -2
- package/types/lodash/mean.d.ts +1 -2
- package/types/lodash/meanBy.d.ts +1 -2
- package/types/lodash/memoize.d.ts +1 -2
- package/types/lodash/merge.d.ts +1 -2
- package/types/lodash/mergeWith.d.ts +1 -2
- package/types/lodash/method.d.ts +1 -2
- package/types/lodash/methodOf.d.ts +1 -2
- package/types/lodash/min-by.d.ts +16 -16
- package/types/lodash/min.d.ts +1 -2
- package/types/lodash/minBy.d.ts +1 -2
- package/types/lodash/mix.d.ts +1 -1
- package/types/lodash/mixin.d.ts +1 -2
- package/types/lodash/mod.d.ts +2 -2
- package/types/lodash/multiply.d.ts +1 -2
- package/types/lodash/negate.d.ts +1 -2
- package/types/lodash/noop.d.ts +1 -2
- package/types/lodash/now.d.ts +1 -2
- package/types/lodash/nth.d.ts +1 -2
- package/types/lodash/nthArg.d.ts +1 -2
- package/types/lodash/number.d.ts +1 -3
- package/types/lodash/number.default.d.ts +6 -8
- package/types/lodash/number2color.d.ts +2 -2
- package/types/lodash/object.d.ts +1 -3
- package/types/lodash/object.default.d.ts +50 -52
- package/types/lodash/omit.d.ts +1 -2
- package/types/lodash/omitBy.d.ts +1 -2
- package/types/lodash/once.d.ts +1 -2
- package/types/lodash/orderBy.d.ts +1 -2
- package/types/lodash/over.d.ts +1 -2
- package/types/lodash/overArgs.d.ts +1 -2
- package/types/lodash/overEvery.d.ts +1 -2
- package/types/lodash/overSome.d.ts +1 -2
- package/types/lodash/pad.d.ts +1 -2
- package/types/lodash/padEnd.d.ts +1 -2
- package/types/lodash/padStart.d.ts +1 -2
- package/types/lodash/parse-radius.d.ts +9 -9
- package/types/lodash/parseInt.d.ts +1 -2
- package/types/lodash/partial.d.ts +1 -2
- package/types/lodash/partialRight.d.ts +1 -2
- package/types/lodash/partition.d.ts +1 -2
- package/types/lodash/pick.d.ts +1 -2
- package/types/lodash/pickBy.d.ts +1 -2
- package/types/lodash/property.d.ts +2 -4
- package/types/lodash/propertyOf.d.ts +1 -2
- package/types/lodash/pull-at.d.ts +2 -2
- package/types/lodash/pull.d.ts +1 -2
- package/types/lodash/pullAll.d.ts +1 -2
- package/types/lodash/pullAllBy.d.ts +1 -2
- package/types/lodash/pullAllWith.d.ts +1 -2
- package/types/lodash/pullAt.d.ts +1 -2
- package/types/lodash/random.d.ts +1 -2
- package/types/lodash/range.d.ts +1 -2
- package/types/lodash/rangeRight.d.ts +1 -2
- package/types/lodash/rearg.d.ts +1 -2
- package/types/lodash/reduce.d.ts +1 -2
- package/types/lodash/reduceRight.d.ts +1 -2
- package/types/lodash/reject.d.ts +1 -2
- package/types/lodash/remove.d.ts +1 -2
- package/types/lodash/repeat.d.ts +1 -2
- package/types/lodash/replace.d.ts +1 -2
- package/types/lodash/request-animation-frame.d.ts +1 -1
- package/types/lodash/rest.d.ts +1 -2
- package/types/lodash/result.d.ts +1 -2
- package/types/lodash/reverse.d.ts +1 -2
- package/types/lodash/round.d.ts +1 -2
- package/types/lodash/sample.d.ts +1 -2
- package/types/lodash/sampleSize.d.ts +1 -2
- package/types/lodash/set.d.ts +1 -2
- package/types/lodash/setWith.d.ts +1 -2
- package/types/lodash/shuffle.d.ts +1 -2
- package/types/lodash/size.d.ts +1 -2
- package/types/lodash/slice.d.ts +1 -2
- package/types/lodash/snakeCase.d.ts +1 -2
- package/types/lodash/some.d.ts +1 -2
- package/types/lodash/sort-by.d.ts +7 -7
- package/types/lodash/sortBy.d.ts +1 -2
- package/types/lodash/sortedIndex.d.ts +1 -2
- package/types/lodash/sortedIndexBy.d.ts +1 -2
- package/types/lodash/sortedIndexOf.d.ts +1 -2
- package/types/lodash/sortedLastIndex.d.ts +1 -2
- package/types/lodash/sortedLastIndexBy.d.ts +1 -2
- package/types/lodash/sortedLastIndexOf.d.ts +1 -2
- package/types/lodash/sortedUniq.d.ts +1 -2
- package/types/lodash/sortedUniqBy.d.ts +1 -2
- package/types/lodash/split.d.ts +1 -2
- package/types/lodash/spread.d.ts +1 -2
- package/types/lodash/startCase.d.ts +1 -2
- package/types/lodash/starts-with.d.ts +3 -3
- package/types/lodash/startsWith.d.ts +1 -2
- package/types/lodash/string.d.ts +1 -3
- package/types/lodash/string.default.d.ts +34 -36
- package/types/lodash/stubArray.d.ts +1 -2
- package/types/lodash/stubFalse.d.ts +1 -2
- package/types/lodash/stubObject.d.ts +1 -2
- package/types/lodash/stubString.d.ts +1 -2
- package/types/lodash/stubTrue.d.ts +1 -2
- package/types/lodash/substitute.d.ts +5 -5
- package/types/lodash/subtract.d.ts +1 -2
- package/types/lodash/sum.d.ts +1 -2
- package/types/lodash/sumBy.d.ts +1 -2
- package/types/lodash/tail.d.ts +1 -2
- package/types/lodash/take.d.ts +1 -2
- package/types/lodash/takeRight.d.ts +1 -2
- package/types/lodash/takeRightWhile.d.ts +1 -2
- package/types/lodash/takeWhile.d.ts +1 -2
- package/types/lodash/tap.d.ts +1 -2
- package/types/lodash/template.d.ts +1 -2
- package/types/lodash/templateSettings.d.ts +1 -2
- package/types/lodash/throttle.d.ts +2 -4
- package/types/lodash/thru.d.ts +1 -2
- package/types/lodash/times.d.ts +1 -2
- package/types/lodash/to-array.d.ts +2 -2
- package/types/lodash/to-degree.d.ts +2 -2
- package/types/lodash/to-integer.d.ts +1 -1
- package/types/lodash/to-radian.d.ts +2 -2
- package/types/lodash/to-string.d.ts +2 -2
- package/types/lodash/toArray.d.ts +1 -2
- package/types/lodash/toFinite.d.ts +1 -2
- package/types/lodash/toInteger.d.ts +1 -2
- package/types/lodash/toLength.d.ts +1 -2
- package/types/lodash/toLower.d.ts +1 -2
- package/types/lodash/toNumber.d.ts +1 -2
- package/types/lodash/toPairs.d.ts +1 -2
- package/types/lodash/toPairsIn.d.ts +1 -2
- package/types/lodash/toPath.d.ts +1 -2
- package/types/lodash/toPlainObject.d.ts +1 -2
- package/types/lodash/toSafeInteger.d.ts +1 -2
- package/types/lodash/toString.d.ts +1 -2
- package/types/lodash/toUpper.d.ts +1 -2
- package/types/lodash/transform.d.ts +1 -2
- package/types/lodash/trim.d.ts +1 -2
- package/types/lodash/trimEnd.d.ts +1 -2
- package/types/lodash/trimStart.d.ts +1 -2
- package/types/lodash/truncate.d.ts +1 -2
- package/types/lodash/types/index.d.ts +3 -3
- package/types/lodash/unary.d.ts +1 -2
- package/types/lodash/unescape.d.ts +1 -2
- package/types/lodash/union.d.ts +1 -2
- package/types/lodash/unionBy.d.ts +1 -2
- package/types/lodash/unionWith.d.ts +1 -2
- package/types/lodash/uniq.d.ts +1 -2
- package/types/lodash/uniqBy.d.ts +1 -2
- package/types/lodash/uniqWith.d.ts +1 -2
- package/types/lodash/unique-id.d.ts +2 -2
- package/types/lodash/uniqueId.d.ts +1 -2
- package/types/lodash/unset.d.ts +1 -2
- package/types/lodash/unzip.d.ts +1 -2
- package/types/lodash/unzipWith.d.ts +1 -2
- package/types/lodash/update.d.ts +1 -2
- package/types/lodash/updateWith.d.ts +1 -2
- package/types/lodash/upper-case.d.ts +2 -2
- package/types/lodash/upper-first.d.ts +2 -2
- package/types/lodash/upperCase.d.ts +1 -2
- package/types/lodash/upperFirst.d.ts +1 -2
- package/types/lodash/util.d.ts +1 -3
- package/types/lodash/util.default.d.ts +35 -37
- package/types/lodash/values-of-key.d.ts +2 -2
- package/types/lodash/values.d.ts +1 -2
- package/types/lodash/valuesIn.d.ts +1 -2
- package/types/lodash/without.d.ts +1 -2
- package/types/lodash/words.d.ts +1 -2
- package/types/lodash/wrap-behavior.d.ts +9 -9
- package/types/lodash/wrap.d.ts +1 -2
- package/types/lodash/xor.d.ts +1 -2
- package/types/lodash/xorBy.d.ts +1 -2
- package/types/lodash/xorWith.d.ts +1 -2
- package/types/lodash/zip.d.ts +1 -2
- package/types/lodash/zipObject.d.ts +1 -2
- package/types/lodash/zipObjectDeep.d.ts +1 -2
- package/types/lodash/zipWith.d.ts +1 -2
- package/types/scheduler.d.ts +46 -0
- package/types/state/StateMachine.d.ts +149 -0
- package/types/state/StateMachinePlus.d.ts +40 -0
- package/types/stats.module.d.ts +3 -3
- package/types/utils/token.d.ts +1 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { RGBA } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Blend two colors with the "normal" blend mode
|
|
4
|
+
*
|
|
5
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
6
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
7
|
+
* @return The blended color
|
|
8
|
+
*/
|
|
9
|
+
export declare function normal(backdrop: RGBA, source: RGBA): RGBA;
|
|
10
|
+
/**
|
|
11
|
+
* Blend two colors with the "multiply" blend mode
|
|
12
|
+
*
|
|
13
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
14
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
15
|
+
* @return The blended color
|
|
16
|
+
*/
|
|
17
|
+
export declare function multiply(backdrop: RGBA, source: RGBA): RGBA;
|
|
18
|
+
/**
|
|
19
|
+
* Blend two colors with the "screen" blend mode
|
|
20
|
+
*
|
|
21
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
22
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
23
|
+
* @return The blended color
|
|
24
|
+
*/
|
|
25
|
+
export declare function screen(backdrop: RGBA, source: RGBA): RGBA;
|
|
26
|
+
/**
|
|
27
|
+
* Blend two colors with the "overlay" blend mode
|
|
28
|
+
*
|
|
29
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
30
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
31
|
+
* @return The blended color
|
|
32
|
+
*/
|
|
33
|
+
export declare function overlay(backdrop: RGBA, source: RGBA): RGBA;
|
|
34
|
+
/**
|
|
35
|
+
* Blend two colors with the "darken" blend mode
|
|
36
|
+
*
|
|
37
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
38
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
39
|
+
* @return The blended color
|
|
40
|
+
*/
|
|
41
|
+
export declare function darken(backdrop: RGBA, source: RGBA): RGBA;
|
|
42
|
+
/**
|
|
43
|
+
* Blend two colors with the "lighten" blend mode
|
|
44
|
+
*
|
|
45
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
46
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
47
|
+
* @return The blended color
|
|
48
|
+
*/
|
|
49
|
+
export declare function lighten(backdrop: RGBA, source: RGBA): RGBA;
|
|
50
|
+
/**
|
|
51
|
+
* Blend two colors with the "color dodge" blend mode
|
|
52
|
+
*
|
|
53
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
54
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
55
|
+
* @return The blended color
|
|
56
|
+
*/
|
|
57
|
+
export declare function colorDodge(backdrop: RGBA, source: RGBA): RGBA;
|
|
58
|
+
/**
|
|
59
|
+
* Blend two colors with the "color burn" blend mode
|
|
60
|
+
*
|
|
61
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
62
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
63
|
+
* @return The blended color
|
|
64
|
+
*/
|
|
65
|
+
export declare function colorBurn(backdrop: RGBA, source: RGBA): RGBA;
|
|
66
|
+
/**
|
|
67
|
+
* Blend two colors with the "hard light" blend mode
|
|
68
|
+
*
|
|
69
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
70
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
71
|
+
* @return The blended color
|
|
72
|
+
*/
|
|
73
|
+
export declare function hardLight(backdrop: RGBA, source: RGBA): RGBA;
|
|
74
|
+
/**
|
|
75
|
+
* Blend two colors with the "soft light" blend mode
|
|
76
|
+
*
|
|
77
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
78
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
79
|
+
* @return The blended color
|
|
80
|
+
*/
|
|
81
|
+
export declare function softLight(backdrop: RGBA, source: RGBA): RGBA;
|
|
82
|
+
/**
|
|
83
|
+
* Blend two colors with the "difference" blend mode
|
|
84
|
+
*
|
|
85
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
86
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
87
|
+
* @return The blended color
|
|
88
|
+
*/
|
|
89
|
+
export declare function difference(backdrop: RGBA, source: RGBA): RGBA;
|
|
90
|
+
/**
|
|
91
|
+
* Blend two colors with the "exclusion" blend mode
|
|
92
|
+
*
|
|
93
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
94
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
95
|
+
* @return The blended color
|
|
96
|
+
*/
|
|
97
|
+
export declare function exclusion(backdrop: RGBA, source: RGBA): RGBA;
|
|
98
|
+
/**
|
|
99
|
+
* Blend two colors with the "hue" blend mode
|
|
100
|
+
*
|
|
101
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
102
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
103
|
+
* @return The blended color
|
|
104
|
+
*/
|
|
105
|
+
export declare function hue(backdrop: RGBA, source: RGBA): RGBA;
|
|
106
|
+
/**
|
|
107
|
+
* Blend two colors with the "saturation" blend mode
|
|
108
|
+
*
|
|
109
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
110
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
111
|
+
* @return The blended color
|
|
112
|
+
*/
|
|
113
|
+
export declare function saturation(backdrop: RGBA, source: RGBA): RGBA;
|
|
114
|
+
/**
|
|
115
|
+
* Blend two colors with the "color" blend mode
|
|
116
|
+
*
|
|
117
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
118
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
119
|
+
* @return The blended color
|
|
120
|
+
*/
|
|
121
|
+
export declare function color(backdrop: RGBA, source: RGBA): RGBA;
|
|
122
|
+
/**
|
|
123
|
+
* Blend two colors with the "luminosity" blend mode
|
|
124
|
+
*
|
|
125
|
+
* @param backdrop The background color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
126
|
+
* @param source The foreground color object { r,g,b,a } with the color channels being integers in the [0..255] range and the alpha channel being a fraction in [0..1]
|
|
127
|
+
* @return The blended color
|
|
128
|
+
*/
|
|
129
|
+
export declare function luminosity(backdrop: RGBA, source: RGBA): RGBA;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NoAlphaBlender, RGBA } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Blend two colors in a non-separable way
|
|
4
|
+
*
|
|
5
|
+
* @param backdrop The background color as an { r,g,b,a } object
|
|
6
|
+
* @param source The foreground color as an { r,g,b,a } object
|
|
7
|
+
* @param callback The blend mode callback to apply
|
|
8
|
+
*/
|
|
9
|
+
export default function nonSeparableBlend(backdrop: RGBA, source: RGBA, callback: NoAlphaBlender): import('./types').RGB;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RGB } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Blend two colors with the "hue" blend mode
|
|
4
|
+
*
|
|
5
|
+
* @param backdrop The background color channel as an { r,g,b } object with each channel represented as a fraction
|
|
6
|
+
* @param source The foreground color channel as an { r,g,b } object with each channel represented as a fraction
|
|
7
|
+
* @return The blended color
|
|
8
|
+
*/
|
|
9
|
+
export declare function hue(backdrop: RGB, source: RGB): RGB;
|
|
10
|
+
/**
|
|
11
|
+
* Blend two colors with the "saturation" blend mode
|
|
12
|
+
*
|
|
13
|
+
* @param backdrop The background color channel as an { r,g,b } object with each channel represented as a fraction
|
|
14
|
+
* @param source The foreground color channel as an { r,g,b } object with each channel represented as a fraction
|
|
15
|
+
* @return The blended color
|
|
16
|
+
*/
|
|
17
|
+
export declare function saturation(backdrop: RGB, source: RGB): RGB;
|
|
18
|
+
/**
|
|
19
|
+
* Blend two colors with the "color" blend mode
|
|
20
|
+
*
|
|
21
|
+
* @param backdrop The background color channel as an { r,g,b } object with each channel represented as a fraction
|
|
22
|
+
* @param source The foreground color channel as an { r,g,b } object with each channel represented as a fraction
|
|
23
|
+
* @return The blended color
|
|
24
|
+
*/
|
|
25
|
+
export declare function color(backdrop: RGB, source: RGB): RGB;
|
|
26
|
+
/**
|
|
27
|
+
* Blend two colors with the "luminosity" blend mode
|
|
28
|
+
*
|
|
29
|
+
* @param backdrop The background color channel as an { r,g,b } object with each channel represented as a fraction
|
|
30
|
+
* @param source The foreground color channel as an { r,g,b } object with each channel represented as a fraction
|
|
31
|
+
* @return The blended color
|
|
32
|
+
*/
|
|
33
|
+
export declare function luminosity(backdrop: RGB, source: RGB): RGB;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChannelBlender, RGB, RGBA } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Blend two colors in a separable way (i.e. each color channel individually)
|
|
4
|
+
*
|
|
5
|
+
* @param backdrop The RGBA backdrop color
|
|
6
|
+
* @param source The RGBA source color
|
|
7
|
+
* @param callback The blend mode callback to apply
|
|
8
|
+
*/
|
|
9
|
+
export default function separableBlend(backdrop: RGBA, source: RGBA, callback: ChannelBlender): RGB;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Algorithms for separable blend modes (i.e. where the same algorithms is applied to each color channel)
|
|
3
|
+
* @see https://www.w3.org/TR/compositing-1/#blendingseparable
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Blend two color channels with the "normal" blend mode
|
|
7
|
+
*
|
|
8
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
9
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
10
|
+
* @return The blended channel value
|
|
11
|
+
*/
|
|
12
|
+
export declare function normal(backdrop: number, source: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* Blend two color channels with the "multiply" blend mode
|
|
15
|
+
*
|
|
16
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
17
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
18
|
+
* @return The blended channel value
|
|
19
|
+
*/
|
|
20
|
+
export declare function multiply(backdrop: number, source: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* Blend two color channels with the "screen" blend mode
|
|
23
|
+
*
|
|
24
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
25
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
26
|
+
* @return The blended channel value
|
|
27
|
+
*/
|
|
28
|
+
export declare function screen(backdrop: number, source: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Blend two color channels with the "overlay" blend mode
|
|
31
|
+
*
|
|
32
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
33
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
34
|
+
* @return The blended channel value
|
|
35
|
+
*/
|
|
36
|
+
export declare function overlay(backdrop: number, source: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Blend two color channels with the "darken" blend mode
|
|
39
|
+
*
|
|
40
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
41
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
42
|
+
* @return The blended channel value
|
|
43
|
+
*/
|
|
44
|
+
export declare function darken(backdrop: number, source: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* Blend two color channels with the "lighten" blend mode
|
|
47
|
+
*
|
|
48
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
49
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
50
|
+
* @return The blended channel value
|
|
51
|
+
*/
|
|
52
|
+
export declare function lighten(backdrop: number, source: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Blend two color channels with the "color dodge" blend mode
|
|
55
|
+
*
|
|
56
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
57
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
58
|
+
* @return The blended channel value
|
|
59
|
+
*/
|
|
60
|
+
export declare function colorDodge(backdrop: number, source: number): number;
|
|
61
|
+
/**
|
|
62
|
+
* Blend two color channels with the "color burn" blend mode
|
|
63
|
+
*
|
|
64
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
65
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
66
|
+
* @return The blended channel value
|
|
67
|
+
*/
|
|
68
|
+
export declare function colorBurn(backdrop: number, source: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* Blend two color channels with the "hard light" blend mode
|
|
71
|
+
*
|
|
72
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
73
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
74
|
+
* @return The blended channel value
|
|
75
|
+
*/
|
|
76
|
+
export declare function hardLight(backdrop: number, source: number): number;
|
|
77
|
+
/**
|
|
78
|
+
* Blend two color channels with the "soft light" blend mode
|
|
79
|
+
*
|
|
80
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
81
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
82
|
+
* @return The blended channel value
|
|
83
|
+
*/
|
|
84
|
+
export declare function softLight(backdrop: number, source: number): number;
|
|
85
|
+
/**
|
|
86
|
+
* Blend two color channels with the "difference" blend mode
|
|
87
|
+
*
|
|
88
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
89
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
90
|
+
* @return The blended channel value
|
|
91
|
+
*/
|
|
92
|
+
export declare function difference(backdrop: number, source: number): number;
|
|
93
|
+
/**
|
|
94
|
+
* Blend two color channels with the "exclusion" blend mode
|
|
95
|
+
*
|
|
96
|
+
* @param backdrop The background color channel as an integer from 0 to 255
|
|
97
|
+
* @param source The foreground color channel as an integer from 0 to 255
|
|
98
|
+
* @return The blended channel value
|
|
99
|
+
*/
|
|
100
|
+
export declare function exclusion(backdrop: number, source: number): number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object representing an RGB color
|
|
3
|
+
*/
|
|
4
|
+
export interface RGB {
|
|
5
|
+
/**
|
|
6
|
+
* Red channel as an integer from 0 to 255
|
|
7
|
+
*/
|
|
8
|
+
r: number;
|
|
9
|
+
/**
|
|
10
|
+
* Green channel as an integer from 0 to 255
|
|
11
|
+
*/
|
|
12
|
+
g: number;
|
|
13
|
+
/**
|
|
14
|
+
* Blue channel as an integer from 0 to 255
|
|
15
|
+
*/
|
|
16
|
+
b: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An object representing an RGB color with an additional alpha channel
|
|
20
|
+
*/
|
|
21
|
+
export interface RGBA extends RGB {
|
|
22
|
+
/**
|
|
23
|
+
* Alpha channel as a fraction from 0 to 1
|
|
24
|
+
*/
|
|
25
|
+
a: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Blends a single color channel of two colors
|
|
29
|
+
*/
|
|
30
|
+
export type ChannelBlender = (backdropChannel: number, sourceChannel: number) => number;
|
|
31
|
+
/**
|
|
32
|
+
* Blends two RGBA colors into RGBA
|
|
33
|
+
*/
|
|
34
|
+
export type AlphaBlender = (backdrop: RGBA, source: RGBA) => RGBA;
|
|
35
|
+
/**
|
|
36
|
+
* Blends two RGB(A) colors into RGB
|
|
37
|
+
*/
|
|
38
|
+
export type NoAlphaBlender = (backdrop: RGB, source: RGB) => RGB;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { RGBA } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Blend two colors with the "normal" blend mode
|
|
4
|
+
*
|
|
5
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
6
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
7
|
+
* @return The blended color
|
|
8
|
+
*/
|
|
9
|
+
export declare function normal(backdrop: RGBA, source: RGBA): RGBA;
|
|
10
|
+
/**
|
|
11
|
+
* Blend two colors with the "multiply" blend mode
|
|
12
|
+
*
|
|
13
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
14
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
15
|
+
* @return The blended color
|
|
16
|
+
*/
|
|
17
|
+
export declare function multiply(backdrop: RGBA, source: RGBA): RGBA;
|
|
18
|
+
/**
|
|
19
|
+
* Blend two colors with the "screen" blend mode
|
|
20
|
+
*
|
|
21
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
22
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
23
|
+
* @return The blended color
|
|
24
|
+
*/
|
|
25
|
+
export declare function screen(backdrop: RGBA, source: RGBA): RGBA;
|
|
26
|
+
/**
|
|
27
|
+
* Blend two colors with the "overlay" blend mode
|
|
28
|
+
*
|
|
29
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
30
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
31
|
+
* @return The blended color
|
|
32
|
+
*/
|
|
33
|
+
export declare function overlay(backdrop: RGBA, source: RGBA): RGBA;
|
|
34
|
+
/**
|
|
35
|
+
* Blend two colors with the "darken" blend mode
|
|
36
|
+
*
|
|
37
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
38
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
39
|
+
* @return The blended color
|
|
40
|
+
*/
|
|
41
|
+
export declare function darken(backdrop: RGBA, source: RGBA): RGBA;
|
|
42
|
+
/**
|
|
43
|
+
* Blend two colors with the "lighten" blend mode
|
|
44
|
+
*
|
|
45
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
46
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
47
|
+
* @return The blended color
|
|
48
|
+
*/
|
|
49
|
+
export declare function lighten(backdrop: RGBA, source: RGBA): RGBA;
|
|
50
|
+
/**
|
|
51
|
+
* Blend two colors with the "color dodge" blend mode
|
|
52
|
+
*
|
|
53
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
54
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
55
|
+
* @return The blended color
|
|
56
|
+
*/
|
|
57
|
+
export declare function colorDodge(backdrop: RGBA, source: RGBA): RGBA;
|
|
58
|
+
/**
|
|
59
|
+
* Blend two colors with the "color burn" blend mode
|
|
60
|
+
*
|
|
61
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
62
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
63
|
+
* @return The blended color
|
|
64
|
+
*/
|
|
65
|
+
export declare function colorBurn(backdrop: RGBA, source: RGBA): RGBA;
|
|
66
|
+
/**
|
|
67
|
+
* Blend two colors with the "hard light" blend mode
|
|
68
|
+
*
|
|
69
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
70
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
71
|
+
* @return The blended color
|
|
72
|
+
*/
|
|
73
|
+
export declare function hardLight(backdrop: RGBA, source: RGBA): RGBA;
|
|
74
|
+
/**
|
|
75
|
+
* Blend two colors with the "soft light" blend mode
|
|
76
|
+
*
|
|
77
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
78
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
79
|
+
* @return The blended color
|
|
80
|
+
*/
|
|
81
|
+
export declare function softLight(backdrop: RGBA, source: RGBA): RGBA;
|
|
82
|
+
/**
|
|
83
|
+
* Blend two colors with the "difference" blend mode
|
|
84
|
+
*
|
|
85
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
86
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
87
|
+
* @return The blended color
|
|
88
|
+
*/
|
|
89
|
+
export declare function difference(backdrop: RGBA, source: RGBA): RGBA;
|
|
90
|
+
/**
|
|
91
|
+
* Blend two colors with the "exclusion" blend mode
|
|
92
|
+
*
|
|
93
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
94
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
95
|
+
* @return The blended color
|
|
96
|
+
*/
|
|
97
|
+
export declare function exclusion(backdrop: RGBA, source: RGBA): RGBA;
|
|
98
|
+
/**
|
|
99
|
+
* Blend two colors with the "hue" blend mode
|
|
100
|
+
*
|
|
101
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
102
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
103
|
+
* @return The blended color
|
|
104
|
+
*/
|
|
105
|
+
export declare function hue(backdrop: RGBA, source: RGBA): RGBA;
|
|
106
|
+
/**
|
|
107
|
+
* Blend two colors with the "saturation" blend mode
|
|
108
|
+
*
|
|
109
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
110
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
111
|
+
* @return The blended color
|
|
112
|
+
*/
|
|
113
|
+
export declare function saturation(backdrop: RGBA, source: RGBA): RGBA;
|
|
114
|
+
/**
|
|
115
|
+
* Blend two colors with the "color" blend mode
|
|
116
|
+
*
|
|
117
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
118
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
119
|
+
* @return The blended color
|
|
120
|
+
*/
|
|
121
|
+
export declare function color(backdrop: RGBA, source: RGBA): RGBA;
|
|
122
|
+
/**
|
|
123
|
+
* Blend two colors with the "luminosity" blend mode
|
|
124
|
+
*
|
|
125
|
+
* @param backdrop The background color object { r,g,b,a } with all channels in the [0..1] range
|
|
126
|
+
* @param source The foreground color object { r,g,b,a } with all channels in the [0..1] range
|
|
127
|
+
* @return The blended color
|
|
128
|
+
*/
|
|
129
|
+
export declare function luminosity(backdrop: RGBA, source: RGBA): RGBA;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { RGBAColor, CompositeOperation, CompositeContext } from './composite-types';
|
|
2
|
+
export declare class CompositeCore implements CompositeContext {
|
|
3
|
+
applyComposite(source: RGBAColor, destination: RGBAColor, operation: CompositeOperation): RGBAColor;
|
|
4
|
+
private sourceOver;
|
|
5
|
+
private sourceIn;
|
|
6
|
+
private sourceOut;
|
|
7
|
+
private sourceAtop;
|
|
8
|
+
private destinationOver;
|
|
9
|
+
private destinationIn;
|
|
10
|
+
private destinationOut;
|
|
11
|
+
private destinationAtop;
|
|
12
|
+
private lighter;
|
|
13
|
+
private copy;
|
|
14
|
+
private xor;
|
|
15
|
+
private multiply;
|
|
16
|
+
private screen;
|
|
17
|
+
private overlay;
|
|
18
|
+
private darken;
|
|
19
|
+
private lighten;
|
|
20
|
+
private colorDodge;
|
|
21
|
+
private difference;
|
|
22
|
+
private hue;
|
|
23
|
+
private premultiply;
|
|
24
|
+
private unpremultiply;
|
|
25
|
+
private rgbToHsl;
|
|
26
|
+
private hslToRgb;
|
|
27
|
+
private saturation;
|
|
28
|
+
private color;
|
|
29
|
+
private luminosity;
|
|
30
|
+
private colorBurn;
|
|
31
|
+
private hardLight;
|
|
32
|
+
private softLight;
|
|
33
|
+
private exclusion;
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CompositeOperation = 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'lighter' | 'copy' | 'xor' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
|
|
2
|
+
export interface RGBAColor {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
a: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CompositeContext {
|
|
9
|
+
applyComposite(source: RGBAColor, destination: RGBAColor, operation: CompositeOperation): RGBAColor;
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CompositeCore } from './composite-core';
|
|
2
|
+
import { CompositeOperation } from './composite-types';
|
|
3
|
+
export declare class ImageDataCompositor extends CompositeCore {
|
|
4
|
+
applyToImageData(sourceData: ImageData, destData: ImageData, operation: CompositeOperation, dx?: number, dy?: number): ImageData;
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CompositeOperation } from './composite-types';
|
|
2
|
+
export declare class WebGLCompositor {
|
|
3
|
+
private gl;
|
|
4
|
+
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext);
|
|
5
|
+
createCompositeProgram(operation: CompositeOperation): WebGLProgram;
|
|
6
|
+
private createVertexShader;
|
|
7
|
+
private createFragmentShader;
|
|
8
|
+
private getBlendFunction;
|
|
9
|
+
private compileShader;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CompositeOperation } from './composite-types';
|
|
2
|
+
export declare class WebGPUCompositor {
|
|
3
|
+
private device;
|
|
4
|
+
private context;
|
|
5
|
+
constructor(device: GPUDevice, context: GPUCanvasContext);
|
|
6
|
+
createCompositePipeline(operation: CompositeOperation): Promise<GPURenderPipeline>;
|
|
7
|
+
private generateWGSLShader;
|
|
8
|
+
private getWGSLBlendFunction;
|
|
9
|
+
private getBlendState;
|
|
10
|
+
}
|