@design-edito/tools 0.3.16 → 0.3.17
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/agnostic/arrays/dedupe/index.js +2 -0
- package/agnostic/arrays/find-duplicates/index.js +2 -0
- package/agnostic/arrays/index.d.ts +1 -1
- package/agnostic/arrays/index.js +1 -1
- package/agnostic/arrays/is-array-of/index.js +4 -2
- package/agnostic/arrays/make/index.js +2 -0
- package/agnostic/arrays/random-pick/index.js +5 -20
- package/agnostic/arrays/shuffle/index.js +2 -0
- package/agnostic/booleans/is-falsy/index.js +7 -10
- package/agnostic/colors/channels/index.js +12 -194
- package/agnostic/colors/contrast/index.js +13 -2
- package/agnostic/colors/convert/index.js +25 -550
- package/agnostic/colors/distance/index.js +10 -1
- package/agnostic/colors/grayscale/index.js +13 -6
- package/agnostic/colors/index.d.ts +3 -3
- package/agnostic/colors/index.js +3 -3
- package/agnostic/colors/invert/index.js +14 -2
- package/agnostic/colors/lerp/index.js +19 -12
- package/agnostic/colors/luminance/index.js +10 -16
- package/agnostic/colors/palette/index.js +12 -1
- package/agnostic/colors/rotate/index.js +11 -36
- package/agnostic/colors/tidy/index.js +9 -56
- package/agnostic/colors/typechecks/index.js +14 -89
- package/agnostic/css/bem/index.js +12 -3
- package/agnostic/css/clss/index.js +4 -28
- package/agnostic/css/generate-nice-color/index.js +2 -0
- package/agnostic/css/index.d.ts +2 -2
- package/agnostic/css/index.js +2 -2
- package/agnostic/css/is-valid-css-class-name/index.js +5 -5
- package/agnostic/css/scale/index.js +8 -2
- package/agnostic/css/styles-set/index.js +6 -1
- package/agnostic/errors/register/index.js +2 -0
- package/agnostic/errors/unknown-to-string/index.js +4 -8
- package/agnostic/html/get-node-ancestors/index.js +5 -18
- package/agnostic/html/get-position-inside-parent/index.js +2 -0
- package/agnostic/html/hyper-json/cast/index.js +22 -105
- package/agnostic/html/hyper-json/index.js +43 -16
- package/agnostic/html/hyper-json/method/index.js +4 -11
- package/agnostic/html/hyper-json/serialize/index.js +8 -67
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +22 -17
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +22 -31
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +22 -16
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +22 -39
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +22 -41
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +22 -31
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +22 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +22 -45
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +22 -28
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +22 -26
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +22 -21
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +23 -58
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.js +22 -23
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.js +24 -68
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +22 -21
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +14 -14
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +14 -14
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +22 -34
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +22 -18
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +22 -19
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +22 -33
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +22 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +22 -35
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +22 -16
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +22 -19
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +22 -68
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +22 -24
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +22 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +22 -32
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +22 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +22 -51
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +22 -31
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +22 -40
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +23 -48
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +22 -34
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +22 -28
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +22 -51
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +23 -170
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +22 -78
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +22 -20
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +22 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +22 -18
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +22 -31
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +22 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +22 -14
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +22 -77
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +22 -15
- package/agnostic/html/hyper-json/smart-tags/index.js +7 -28
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +8 -14
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +8 -11
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +22 -13
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +22 -24
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +22 -20
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +22 -15
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +22 -47
- package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +2 -2
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +22 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +8 -11
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +22 -19
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +22 -15
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +23 -38
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +22 -19
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +22 -21
- package/agnostic/html/hyper-json/transformer/index.js +6 -121
- package/agnostic/html/hyper-json/tree/index.js +22 -427
- package/agnostic/html/hyper-json/types/index.js +4 -16
- package/agnostic/html/hyper-json/utils/index.js +22 -426
- package/agnostic/html/index.d.ts +1 -1
- package/agnostic/html/index.js +1 -1
- package/agnostic/html/insert-node/index.js +4 -14
- package/agnostic/html/placeholders/index.js +2 -0
- package/agnostic/html/replace-in-element/index.js +6 -1
- package/agnostic/html/selector-to-element/index.js +6 -2
- package/agnostic/html/string-to-nodes/index.js +6 -2
- package/agnostic/index.d.ts +6 -6
- package/agnostic/index.js +6 -6
- package/agnostic/misc/assert/index.js +15 -8
- package/agnostic/misc/cast/index.js +13 -47
- package/agnostic/misc/connection/index.js +6 -2
- package/agnostic/misc/crawler/index.js +5 -1
- package/agnostic/misc/crossenv/detect-runtime/index.js +10 -8
- package/agnostic/misc/crossenv/types.js +4 -11
- package/agnostic/misc/crossenv/window/index.js +7 -22
- package/agnostic/misc/data-size/index.js +2 -0
- package/agnostic/misc/index.d.ts +4 -4
- package/agnostic/misc/index.js +4 -4
- package/agnostic/misc/is-constructor-function/index.js +4 -4
- package/agnostic/misc/is-nullish/index.js +6 -8
- package/agnostic/misc/logs/index.d.ts +1 -1
- package/agnostic/misc/logs/index.js +1 -1
- package/agnostic/misc/logs/logger/index.js +2 -0
- package/agnostic/misc/logs/make-text-block/index.js +4 -11
- package/agnostic/misc/logs/styles/index.js +5 -36
- package/agnostic/misc/lorem-ipsum/index.js +8 -2
- package/agnostic/misc/normalize-extension/index.js +2 -0
- package/agnostic/misc/outcome/index.js +6 -10
- package/agnostic/numbers/absolute-modulo/index.js +4 -4
- package/agnostic/numbers/approximate-rational/index.js +2 -0
- package/agnostic/numbers/clamp/index.js +4 -6
- package/agnostic/numbers/geometric-progressions/index.js +4 -14
- package/agnostic/numbers/index.d.ts +1 -1
- package/agnostic/numbers/index.js +1 -1
- package/agnostic/numbers/interpolate/index.js +2 -0
- package/agnostic/numbers/round/index.js +6 -13
- package/agnostic/objects/deep-get-property/index.js +5 -1
- package/agnostic/objects/enums/is-in-enum/index.js +4 -9
- package/agnostic/objects/flatten-getters/index.js +2 -0
- package/agnostic/objects/index.d.ts +2 -2
- package/agnostic/objects/index.js +2 -2
- package/agnostic/objects/is-object/index.js +5 -7
- package/agnostic/objects/is-record/index.js +4 -5
- package/agnostic/objects/record-format/index.js +2 -0
- package/agnostic/objects/record-map/index.js +4 -10
- package/agnostic/objects/sort-keys/index.js +2 -0
- package/agnostic/objects/validation/index.js +2 -0
- package/agnostic/optim/index.d.ts +1 -1
- package/agnostic/optim/index.js +1 -1
- package/agnostic/optim/memoize/index.js +2 -0
- package/agnostic/optim/throttle-debounce/index.js +2 -0
- package/agnostic/random/hex-char/index.js +5 -7
- package/agnostic/random/random/index.js +5 -12
- package/agnostic/random/uuid/index.js +7 -11
- package/agnostic/regexps/index.js +2 -0
- package/agnostic/sanitization/file-name/index.js +4 -6
- package/agnostic/sanitization/html/index.js +7 -3
- package/agnostic/sanitization/index.d.ts +2 -2
- package/agnostic/sanitization/index.js +2 -2
- package/agnostic/sanitization/path/index.js +5 -1
- package/agnostic/sanitization/user-input/index.js +2 -0
- package/agnostic/strings/char-codes/index.js +2 -0
- package/agnostic/strings/index.d.ts +4 -4
- package/agnostic/strings/index.js +4 -4
- package/agnostic/strings/matches/index.js +6 -14
- package/agnostic/strings/normalize-indent/index.js +2 -0
- package/agnostic/strings/parse-table/index.js +11 -6
- package/agnostic/strings/replace-all/index.js +4 -13
- package/agnostic/strings/to-alphanum/index.js +2 -0
- package/agnostic/strings/trim/index.js +5 -7
- package/agnostic/time/dates/format-date/index.js +2 -0
- package/agnostic/time/duration/index.js +2 -0
- package/agnostic/time/index.d.ts +1 -1
- package/agnostic/time/index.js +1 -1
- package/agnostic/time/timeout/index.js +2 -0
- package/agnostic/time/transitions/index.js +5 -1
- package/agnostic/time/wait/index.js +4 -6
- package/chunks/chunk-2FNCUXAX.js +27 -0
- package/chunks/chunk-2GJSPEO4.js +31 -0
- package/chunks/chunk-2IGP6V77.js +22 -0
- package/chunks/chunk-3DNVFA25.js +38 -0
- package/chunks/chunk-3K4JD65D.js +130 -0
- package/chunks/chunk-3QI2MSDK.js +34 -0
- package/chunks/chunk-3RNLPW7B.js +101 -0
- package/chunks/chunk-3RZMW72G.js +33 -0
- package/chunks/chunk-4KLCJX2T.js +36 -0
- package/chunks/chunk-4LTN4SCD.js +55 -0
- package/chunks/chunk-4Q4T7QQO.js +27 -0
- package/chunks/chunk-4Q5TKOIG.js +53 -0
- package/chunks/chunk-4STX5SQX.js +131 -0
- package/chunks/chunk-57YKZBJR.js +29 -0
- package/chunks/chunk-5H3IRSOB.js +8 -0
- package/chunks/chunk-5NTPCRFH.js +32 -0
- package/chunks/chunk-5TM235Z3.js +40 -0
- package/chunks/chunk-5WVGUZL5.js +35 -0
- package/chunks/chunk-6XL25OZX.js +12 -0
- package/chunks/chunk-75BICI4L.js +20 -0
- package/chunks/chunk-77SWZUHV.js +31 -0
- package/chunks/chunk-AG4VERYN.js +25 -0
- package/chunks/chunk-AP3VYSVF.js +36 -0
- package/chunks/chunk-AS4CIZVE.js +109 -0
- package/chunks/chunk-ASXK7XCC.js +18 -0
- package/chunks/chunk-AVIMGMTP.js +17 -0
- package/chunks/chunk-B5V7D2ZL.js +77 -0
- package/chunks/chunk-B6653QJD.js +37 -0
- package/chunks/chunk-BCX4HPD7.js +33 -0
- package/chunks/chunk-CVMYA5XK.js +632 -0
- package/chunks/chunk-DMWGHBIL.js +25 -0
- package/chunks/chunk-DNIOWD7K.js +8 -0
- package/chunks/chunk-DU6U226H.js +23 -0
- package/chunks/chunk-E2ZY3SEW.js +26 -0
- package/chunks/chunk-E6MSDKON.js +13 -0
- package/chunks/chunk-E7BBN5JC.js +22 -0
- package/chunks/chunk-EPUHVR7J.js +17 -0
- package/chunks/chunk-EX2QKFY5.js +41 -0
- package/chunks/chunk-EYYNCLVR.js +33 -0
- package/chunks/chunk-FCABYQRX.js +37 -0
- package/chunks/chunk-FJH35B3Q.js +20 -0
- package/chunks/chunk-FSNNEPY5.js +37 -0
- package/chunks/chunk-GQBFMP6N.js +32 -0
- package/chunks/chunk-H3HRQ52T.js +32 -0
- package/chunks/chunk-H4KLHV6B.js +78 -0
- package/chunks/chunk-H4PP6AHP.js +15 -0
- package/chunks/chunk-HC6ZOHCS.js +14 -0
- package/chunks/chunk-HMMPT3UM.js +47 -0
- package/chunks/chunk-HQLRJ7XW.js +12 -0
- package/chunks/chunk-HYPEWMYZ.js +10 -0
- package/chunks/chunk-I5MRXMHR.js +32 -0
- package/chunks/chunk-I6ZP5T5V.js +10 -0
- package/chunks/chunk-IPRWXI27.js +31 -0
- package/chunks/chunk-IRKZUMWZ.js +38 -0
- package/chunks/chunk-ISJONMNA.js +16 -0
- package/chunks/chunk-JB27MAKY.js +22 -0
- package/chunks/chunk-JZ6GM444.js +43 -0
- package/chunks/chunk-K5UF634H.js +25 -0
- package/chunks/chunk-KKYEOIJI.js +195 -0
- package/chunks/chunk-LJ5MGLLU.js +56 -0
- package/chunks/chunk-LUAYN7VJ.js +27 -0
- package/chunks/chunk-MDVGDZU6.js +25 -0
- package/chunks/chunk-ML22TIBW.js +37 -0
- package/chunks/chunk-MO4TRYNI.js +29 -0
- package/chunks/chunk-NIBRPZJD.js +58 -0
- package/chunks/chunk-OAX7GS7C.js +36 -0
- package/chunks/chunk-OBSTP7YR.js +257 -0
- package/chunks/chunk-OEVSF7D3.js +82 -0
- package/chunks/chunk-OFCSIK6J.js +13 -0
- package/chunks/chunk-OFYGPRWE.js +21 -0
- package/chunks/chunk-OGBUSUE6.js +12 -0
- package/chunks/chunk-OSAXBA7G.js +10 -0
- package/chunks/chunk-OT7QXCH6.js +23 -0
- package/chunks/chunk-P4J6S2WQ.js +64 -0
- package/chunks/chunk-PUQUSA6S.js +12 -0
- package/chunks/chunk-QDHET2TE.js +20 -0
- package/chunks/chunk-QHEWBOQI.js +19 -0
- package/chunks/chunk-QQPOSZFR.js +2701 -0
- package/chunks/chunk-QXAJXTXV.js +19 -0
- package/chunks/chunk-R3AWQXMY.js +20 -0
- package/chunks/chunk-R66GH2MQ.js +38 -0
- package/chunks/chunk-RART44AF.js +21 -0
- package/chunks/chunk-REXSJULD.js +28 -0
- package/chunks/chunk-RKX6KLPQ.js +47 -0
- package/chunks/chunk-RW7VAKJW.js +15 -0
- package/chunks/chunk-RZOR7ZC3.js +35 -0
- package/chunks/chunk-S2UZ3HZR.js +31 -0
- package/chunks/chunk-SPC2SMZR.js +82 -0
- package/chunks/chunk-SYH5LYQC.js +28 -0
- package/chunks/chunk-TAXFCVFE.js +30 -0
- package/chunks/chunk-TNZGRXKJ.js +24 -0
- package/chunks/chunk-TRFZSKNB.js +32 -0
- package/chunks/chunk-U664BT44.js +45 -0
- package/chunks/chunk-U6SGKHHA.js +32 -0
- package/chunks/chunk-UTQNGKGQ.js +60 -0
- package/chunks/chunk-UVG2S54P.js +93 -0
- package/chunks/chunk-VPBZS3S4.js +27 -0
- package/chunks/chunk-W5A2TON3.js +10 -0
- package/chunks/chunk-W7PJ5NQQ.js +23 -0
- package/chunks/chunk-WGRQXVBK.js +207 -0
- package/chunks/chunk-WIFHP4X7.js +56 -0
- package/chunks/chunk-WL4WNJ2Y.js +39 -0
- package/chunks/chunk-WNDMYNDU.js +8 -0
- package/chunks/chunk-WSFCRVEQ.js +9 -0
- package/chunks/chunk-WZS4Q3G3.js +36 -0
- package/chunks/chunk-XA4HVHJ4.js +18 -0
- package/chunks/chunk-XEQ2PBT2.js +20 -0
- package/chunks/chunk-XIIJYVJZ.js +15 -0
- package/chunks/chunk-XNF5MLCQ.js +14 -0
- package/chunks/chunk-XQUMWHCH.js +25 -0
- package/chunks/chunk-YA2YCZUF.js +8 -0
- package/chunks/chunk-YDIBNEGA.js +9 -0
- package/chunks/chunk-YHMR7IBA.js +24 -0
- package/chunks/chunk-YWSXCFYY.js +61 -0
- package/chunks/chunk-YY3TSU22.js +48 -0
- package/chunks/chunk-ZAP3ELDE.js +40 -0
- package/chunks/chunk-ZJR5ASR3.js +26 -0
- package/chunks/index.d.ts +1 -0
- package/chunks/index.js +1 -0
- package/components/BeforeAfter/index.css +1 -0
- package/components/BeforeAfter/index.js +120 -5
- package/components/Disclaimer/index.css +1 -0
- package/components/Disclaimer/index.js +6 -66
- package/components/Drawer/index.css +2 -0
- package/components/Drawer/index.js +22 -10
- package/components/EventListener/index.css +1 -0
- package/components/EventListener/index.js +17 -5
- package/components/Gallery/index.css +29 -0
- package/components/Gallery/index.js +35 -6
- package/components/Image/index.css +3 -0
- package/components/Image/index.js +23 -11
- package/components/IntersectionObserver/index.css +1 -0
- package/components/IntersectionObserver/index.js +6 -66
- package/components/Paginator/index.css +10 -0
- package/components/Paginator/index.js +6 -112
- package/components/ResizeObserver/index.css +1 -0
- package/components/ResizeObserver/index.js +6 -77
- package/components/Scrllgngn/index.css +69 -0
- package/components/Scrllgngn/index.js +46 -18
- package/components/ScrollListener/index.css +2 -0
- package/components/ScrollListener/index.js +92 -26
- package/components/Sequencer/index.css +2 -0
- package/components/Sequencer/index.js +70 -11
- package/components/ShadowRoot/index.css +1 -0
- package/components/ShadowRoot/index.js +21 -9
- package/components/Subtitles/index.css +1 -0
- package/components/Subtitles/index.js +10 -107
- package/components/Theatre/index.css +1 -0
- package/components/Theatre/index.js +6 -93
- package/components/UIModule/index.css +1 -0
- package/components/UIModule/index.js +28 -9
- package/components/Video/index.css +4 -0
- package/components/Video/index.js +159 -34
- package/components/index.d.ts +3 -3
- package/components/index.js +3 -3
- package/components/utils/index.js +4 -9
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/node/@aws-s3/storage/directory/copy-dir/index.js +5 -53
- package/node/@aws-s3/storage/directory/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/index.js +1 -1
- package/node/@aws-s3/storage/directory/list/index.js +5 -22
- package/node/@aws-s3/storage/directory/move-dir/index.js +5 -66
- package/node/@aws-s3/storage/directory/remove-dir/index.js +5 -49
- package/node/@aws-s3/storage/file/copy/index.js +5 -34
- package/node/@aws-s3/storage/file/download/index.js +5 -20
- package/node/@aws-s3/storage/file/exists/index.js +5 -24
- package/node/@aws-s3/storage/file/index.d.ts +3 -3
- package/node/@aws-s3/storage/file/index.js +3 -3
- package/node/@aws-s3/storage/file/move/index.js +5 -45
- package/node/@aws-s3/storage/file/remove/index.js +5 -25
- package/node/@aws-s3/storage/file/stat/index.js +5 -27
- package/node/@aws-s3/storage/file/upload/index.js +5 -45
- package/node/@express/@multer/index.js +12 -5
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +11 -4
- package/node/@google-cloud/storage/directory/copy-dir/index.js +6 -26
- package/node/@google-cloud/storage/directory/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/index.js +1 -1
- package/node/@google-cloud/storage/directory/list/index.js +6 -18
- package/node/@google-cloud/storage/directory/move-dir/index.js +6 -26
- package/node/@google-cloud/storage/directory/remove-dir/index.js +6 -22
- package/node/@google-cloud/storage/file/copy/index.js +6 -24
- package/node/@google-cloud/storage/file/download/index.js +6 -17
- package/node/@google-cloud/storage/file/exists/index.js +6 -14
- package/node/@google-cloud/storage/file/generate-signed-url/index.js +11 -4
- package/node/@google-cloud/storage/file/get-metadata/index.js +11 -4
- package/node/@google-cloud/storage/file/get-permissions/index.js +11 -4
- package/node/@google-cloud/storage/file/index.d.ts +3 -3
- package/node/@google-cloud/storage/file/index.js +3 -3
- package/node/@google-cloud/storage/file/move/index.js +6 -26
- package/node/@google-cloud/storage/file/remove/index.js +6 -19
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +16 -5
- package/node/@google-cloud/storage/file/stat/index.js +6 -21
- package/node/@google-cloud/storage/file/update-metadata/index.js +11 -4
- package/node/@google-cloud/storage/file/upload/index.js +6 -31
- package/node/cloud-storage/clients/index.js +7 -9
- package/node/cloud-storage/index.d.ts +1 -1
- package/node/cloud-storage/index.js +1 -1
- package/node/cloud-storage/operations/copy-dir/index.js +26 -21
- package/node/cloud-storage/operations/copy-file/index.js +25 -12
- package/node/cloud-storage/operations/download-file/index.js +25 -12
- package/node/cloud-storage/operations/exists-file/index.js +25 -12
- package/node/cloud-storage/operations/index.d.ts +3 -3
- package/node/cloud-storage/operations/index.js +3 -3
- package/node/cloud-storage/operations/list-dir/index.js +25 -12
- package/node/cloud-storage/operations/move-dir/index.js +27 -14
- package/node/cloud-storage/operations/move-file/index.js +25 -12
- package/node/cloud-storage/operations/remove-dir/index.js +27 -14
- package/node/cloud-storage/operations/remove-file/index.js +25 -12
- package/node/cloud-storage/operations/stat-file/index.js +25 -12
- package/node/cloud-storage/operations/upload-file/index.js +25 -12
- package/node/encryption/@aes-256-gcm/buffer/index.js +12 -7
- package/node/encryption/@aes-256-gcm/uint8-array/index.js +7 -36
- package/node/encryption/key/index.js +2 -0
- package/node/files/is-in-directory/index.js +2 -0
- package/node/files/read-write/index.js +2 -0
- package/node/files/subpaths/index.js +7 -3
- package/node/ftps/directory/copy-dir/index.js +6 -45
- package/node/ftps/directory/index.d.ts +1 -1
- package/node/ftps/directory/index.js +1 -1
- package/node/ftps/directory/list/index.js +6 -12
- package/node/ftps/directory/move-dir/index.js +6 -23
- package/node/ftps/directory/remove-dir/index.js +6 -27
- package/node/ftps/file/copy/index.js +6 -30
- package/node/ftps/file/download/index.js +6 -15
- package/node/ftps/file/exists/index.js +6 -17
- package/node/ftps/file/index.d.ts +1 -1
- package/node/ftps/file/index.js +1 -1
- package/node/ftps/file/move/index.js +6 -29
- package/node/ftps/file/remove/index.js +6 -25
- package/node/ftps/file/stat/index.js +6 -21
- package/node/ftps/file/upload/index.js +6 -30
- package/node/images/create/index.js +11 -1
- package/node/images/format/index.js +26 -11
- package/node/images/index.d.ts +1 -1
- package/node/images/index.js +1 -1
- package/node/images/metadata/index.js +11 -1
- package/node/images/transform/index.js +128 -73
- package/node/images/transform/operations/blur/index.js +6 -12
- package/node/images/transform/operations/brighten/index.js +6 -12
- package/node/images/transform/operations/extend/index.js +13 -24
- package/node/images/transform/operations/extract/index.js +6 -17
- package/node/images/transform/operations/flatten/index.js +13 -19
- package/node/images/transform/operations/flip/index.js +4 -4
- package/node/images/transform/operations/flop/index.js +4 -4
- package/node/images/transform/operations/hue/index.js +6 -14
- package/node/images/transform/operations/index.d.ts +5 -5
- package/node/images/transform/operations/index.js +5 -5
- package/node/images/transform/operations/level/index.js +6 -18
- package/node/images/transform/operations/lighten/index.js +6 -14
- package/node/images/transform/operations/normalize/index.js +6 -15
- package/node/images/transform/operations/overlay/index.js +13 -87
- package/node/images/transform/operations/resize/index.js +13 -45
- package/node/images/transform/operations/rotate/index.js +13 -19
- package/node/images/transform/operations/saturate/index.js +6 -16
- package/node/images/types.js +5 -27
- package/node/images/utils/index.js +13 -35
- package/node/index.d.ts +3 -3
- package/node/index.js +3 -3
- package/node/process/index.d.ts +1 -1
- package/node/process/index.js +1 -1
- package/node/process/on-exit/index.js +2 -0
- package/node/process/prompt-continue/index.js +2 -0
- package/node/process/spawner/index.js +17 -7
- package/node/sftp/directory/copy-dir/index.js +6 -43
- package/node/sftp/directory/index.d.ts +1 -1
- package/node/sftp/directory/index.js +1 -1
- package/node/sftp/directory/list/index.js +6 -12
- package/node/sftp/directory/move-dir/index.js +6 -20
- package/node/sftp/directory/remove-dir/index.js +6 -27
- package/node/sftp/file/copy/index.js +6 -28
- package/node/sftp/file/download/index.js +6 -15
- package/node/sftp/file/exists/index.js +6 -12
- package/node/sftp/file/index.d.ts +2 -2
- package/node/sftp/file/index.js +2 -2
- package/node/sftp/file/move/index.js +6 -23
- package/node/sftp/file/remove/index.js +6 -18
- package/node/sftp/file/stat/index.js +6 -21
- package/node/sftp/file/upload/index.js +6 -22
- package/package.json +8 -1
|
@@ -1,554 +1,29 @@
|
|
|
1
|
-
// src/agnostic/colors/convert/index.ts
|
|
2
|
-
import { absoluteModulo } from "../../numbers/absolute-modulo/index.js";
|
|
3
|
-
import { tidy } from "../tidy/index.js";
|
|
4
|
-
import { cssColors } from "../cssColorsMap.js";
|
|
5
1
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const r = parseInt(hexString.slice(0, 2), 16);
|
|
32
|
-
const g = parseInt(hexString.slice(2, 4), 16);
|
|
33
|
-
const b = parseInt(hexString.slice(4, 6), 16);
|
|
34
|
-
const a = parseInt(hexString.slice(6, 8), 16) / 255;
|
|
35
|
-
return { r, g, b, a };
|
|
36
|
-
}
|
|
37
|
-
function _rgb2hex(rgb) {
|
|
38
|
-
const { r, g, b, a = 1 } = rgb;
|
|
39
|
-
const rHex = Math.round(r).toString(16).padStart(2, "0");
|
|
40
|
-
const gHex = Math.round(g).toString(16).padStart(2, "0");
|
|
41
|
-
const bHex = Math.round(b).toString(16).padStart(2, "0");
|
|
42
|
-
const aHex = Math.round(a * 255).toString(16).padStart(2, "0");
|
|
43
|
-
const returned = `#${rHex}${gHex}${bHex}${aHex}`;
|
|
44
|
-
if (!isHex(returned)) {
|
|
45
|
-
throw new Error(`invalid hex color output ${unknownToString(returned)}`);
|
|
46
|
-
}
|
|
47
|
-
return returned;
|
|
48
|
-
}
|
|
49
|
-
function _css2rgb(color) {
|
|
50
|
-
if (color in cssColors) return cssColors[color];
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
var cssColorsWithHex = Object.entries(cssColors).map(([cssColor, rgba]) => ({
|
|
54
|
-
name: cssColor,
|
|
55
|
-
hex: _rgb2hex(rgba),
|
|
56
|
-
rgba
|
|
57
|
-
}));
|
|
58
|
-
function _rgb2css(rgb) {
|
|
59
|
-
const hexTarget = _rgb2hex(rgb);
|
|
60
|
-
return cssColorsWithHex.find((c) => c.hex === hexTarget)?.name;
|
|
61
|
-
}
|
|
62
|
-
function _hsl2rgb(hsl) {
|
|
63
|
-
const { h, s, l, a = 1 } = hsl;
|
|
64
|
-
const H = absoluteModulo(h, 360) / 360;
|
|
65
|
-
const S = Math.max(0, Math.min(1, s / 100));
|
|
66
|
-
const L = Math.max(0, Math.min(1, l / 100));
|
|
67
|
-
const A = Math.max(0, Math.min(1, a));
|
|
68
|
-
const hue2rgb = (p, q, t) => {
|
|
69
|
-
if (t < 0) t += 1;
|
|
70
|
-
if (t > 1) t -= 1;
|
|
71
|
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
72
|
-
if (t < 1 / 2) return q;
|
|
73
|
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
74
|
-
return p;
|
|
75
|
-
};
|
|
76
|
-
let r;
|
|
77
|
-
let g;
|
|
78
|
-
let b;
|
|
79
|
-
if (S === 0) {
|
|
80
|
-
r = g = b = L;
|
|
81
|
-
} else {
|
|
82
|
-
const q = L < 0.5 ? L * (1 + S) : L + S - L * S;
|
|
83
|
-
const p = 2 * L - q;
|
|
84
|
-
r = hue2rgb(p, q, H + 1 / 3);
|
|
85
|
-
g = hue2rgb(p, q, H);
|
|
86
|
-
b = hue2rgb(p, q, H - 1 / 3);
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
r: Math.round(r * 255),
|
|
90
|
-
g: Math.round(g * 255),
|
|
91
|
-
b: Math.round(b * 255),
|
|
92
|
-
a: A
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function _rgb2hsl(rgb) {
|
|
96
|
-
const { r, g, b, a = 1 } = rgb;
|
|
97
|
-
const R = r / 255;
|
|
98
|
-
const G = g / 255;
|
|
99
|
-
const B = b / 255;
|
|
100
|
-
const max = Math.max(R, G, B);
|
|
101
|
-
const min = Math.min(R, G, B);
|
|
102
|
-
const delta = max - min;
|
|
103
|
-
let h = 0;
|
|
104
|
-
let s = 0;
|
|
105
|
-
const l = (max + min) / 2;
|
|
106
|
-
if (delta !== 0) {
|
|
107
|
-
s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
108
|
-
if (max === R) {
|
|
109
|
-
h = ((G - B) / delta + (G < B ? 6 : 0)) / 6;
|
|
110
|
-
} else if (max === G) {
|
|
111
|
-
h = ((B - R) / delta + 2) / 6;
|
|
112
|
-
} else {
|
|
113
|
-
h = ((R - G) / delta + 4) / 6;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
h: Math.round(h * 360),
|
|
118
|
-
s: Math.round(s * 100),
|
|
119
|
-
l: Math.round(l * 100),
|
|
120
|
-
a
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function _hsb2rgb(hsb) {
|
|
124
|
-
const { h, s, b, a = 1 } = hsb;
|
|
125
|
-
const H = absoluteModulo(h, 360) / 360;
|
|
126
|
-
const S = Math.max(0, Math.min(1, s / 100));
|
|
127
|
-
const B = Math.max(0, Math.min(1, b / 100));
|
|
128
|
-
const A = Math.max(0, Math.min(1, a));
|
|
129
|
-
const i = Math.floor(H * 6);
|
|
130
|
-
const f = H * 6 - i;
|
|
131
|
-
const p = B * (1 - S);
|
|
132
|
-
const q = B * (1 - f * S);
|
|
133
|
-
const t = B * (1 - (1 - f) * S);
|
|
134
|
-
let r;
|
|
135
|
-
let g;
|
|
136
|
-
let blue;
|
|
137
|
-
switch (absoluteModulo(i, 6)) {
|
|
138
|
-
case 0:
|
|
139
|
-
r = B;
|
|
140
|
-
g = t;
|
|
141
|
-
blue = p;
|
|
142
|
-
break;
|
|
143
|
-
case 1:
|
|
144
|
-
r = q;
|
|
145
|
-
g = B;
|
|
146
|
-
blue = p;
|
|
147
|
-
break;
|
|
148
|
-
case 2:
|
|
149
|
-
r = p;
|
|
150
|
-
g = B;
|
|
151
|
-
blue = t;
|
|
152
|
-
break;
|
|
153
|
-
case 3:
|
|
154
|
-
r = p;
|
|
155
|
-
g = q;
|
|
156
|
-
blue = B;
|
|
157
|
-
break;
|
|
158
|
-
case 4:
|
|
159
|
-
r = t;
|
|
160
|
-
g = p;
|
|
161
|
-
blue = B;
|
|
162
|
-
break;
|
|
163
|
-
case 5:
|
|
164
|
-
r = B;
|
|
165
|
-
g = p;
|
|
166
|
-
blue = q;
|
|
167
|
-
break;
|
|
168
|
-
default:
|
|
169
|
-
r = g = blue = 0;
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
r: Math.round(r * 255),
|
|
173
|
-
g: Math.round(g * 255),
|
|
174
|
-
b: Math.round(blue * 255),
|
|
175
|
-
a: A
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function _rgb2hsb(rgb) {
|
|
179
|
-
const { r, g, b, a = 1 } = rgb;
|
|
180
|
-
const R = r / 255;
|
|
181
|
-
const G = g / 255;
|
|
182
|
-
const B = b / 255;
|
|
183
|
-
const max = Math.max(R, G, B);
|
|
184
|
-
const min = Math.min(R, G, B);
|
|
185
|
-
const delta = max - min;
|
|
186
|
-
let h = 0;
|
|
187
|
-
let s = 0;
|
|
188
|
-
const brightness = max;
|
|
189
|
-
if (max !== 0) {
|
|
190
|
-
s = delta / max;
|
|
191
|
-
}
|
|
192
|
-
if (delta !== 0) {
|
|
193
|
-
if (max === R) {
|
|
194
|
-
h = ((G - B) / delta + (G < B ? 6 : 0)) / 6;
|
|
195
|
-
} else if (max === G) {
|
|
196
|
-
h = ((B - R) / delta + 2) / 6;
|
|
197
|
-
} else {
|
|
198
|
-
h = ((R - G) / delta + 4) / 6;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return {
|
|
202
|
-
h: Math.round(h * 360),
|
|
203
|
-
s: Math.round(s * 100),
|
|
204
|
-
b: Math.round(brightness * 100),
|
|
205
|
-
a
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function _cmyk2rgb(cmyka) {
|
|
209
|
-
const { c, m, y, k, a = 1 } = cmyka;
|
|
210
|
-
const C = Math.max(0, Math.min(100, c)) / 100;
|
|
211
|
-
const M = Math.max(0, Math.min(100, m)) / 100;
|
|
212
|
-
const Y = Math.max(0, Math.min(100, y)) / 100;
|
|
213
|
-
const K = Math.max(0, Math.min(100, k)) / 100;
|
|
214
|
-
const A = Math.max(0, Math.min(1, a));
|
|
215
|
-
const R = 1 - Math.min(1, C * (1 - K) + K);
|
|
216
|
-
const G = 1 - Math.min(1, M * (1 - K) + K);
|
|
217
|
-
const B = 1 - Math.min(1, Y * (1 - K) + K);
|
|
218
|
-
return {
|
|
219
|
-
r: Math.round(R * 255),
|
|
220
|
-
g: Math.round(G * 255),
|
|
221
|
-
b: Math.round(B * 255),
|
|
222
|
-
a: A
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
function _rgb2cmyk(rgb) {
|
|
226
|
-
const { r, g, b, a = 1 } = rgb;
|
|
227
|
-
const R = Math.max(0, Math.min(1, r / 255));
|
|
228
|
-
const G = Math.max(0, Math.min(1, g / 255));
|
|
229
|
-
const B = Math.max(0, Math.min(1, b / 255));
|
|
230
|
-
const A = Math.max(0, Math.min(1, a));
|
|
231
|
-
const K = 1 - Math.max(R, G, B);
|
|
232
|
-
const denom = 1 - K || 1;
|
|
233
|
-
const C = (1 - R - K) / denom;
|
|
234
|
-
const M = (1 - G - K) / denom;
|
|
235
|
-
const Y = (1 - B - K) / denom;
|
|
236
|
-
return {
|
|
237
|
-
c: Math.round(C * 100),
|
|
238
|
-
m: Math.round(M * 100),
|
|
239
|
-
y: Math.round(Y * 100),
|
|
240
|
-
k: Math.round(K * 100),
|
|
241
|
-
a: A
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function _xyz2rgb(xyza) {
|
|
245
|
-
const { x, y, z, a = 1 } = xyza;
|
|
246
|
-
const X = x / 100;
|
|
247
|
-
const Y = y / 100;
|
|
248
|
-
const Z = z / 100;
|
|
249
|
-
const A = Math.max(0, Math.min(1, a));
|
|
250
|
-
let R = X * 3.2404542 + Y * -1.5371385 + Z * -0.4985314;
|
|
251
|
-
let G = X * -0.969266 + Y * 1.8760108 + Z * 0.041556;
|
|
252
|
-
let B = X * 0.0556434 + Y * -0.2040259 + Z * 1.0572252;
|
|
253
|
-
const GAMMA_THRESHOLD = 31308e-7;
|
|
254
|
-
const GAMMA_EXPONENT = 1 / 2.4;
|
|
255
|
-
const GAMMA_MULT = 1.055;
|
|
256
|
-
const GAMMA_OFFSET = 0.055;
|
|
257
|
-
const LINEAR_DIVISOR = 12.92;
|
|
258
|
-
const gammaCorrect = (c) => c <= GAMMA_THRESHOLD ? c * LINEAR_DIVISOR : GAMMA_MULT * Math.pow(c, GAMMA_EXPONENT) - GAMMA_OFFSET;
|
|
259
|
-
R = gammaCorrect(R);
|
|
260
|
-
G = gammaCorrect(G);
|
|
261
|
-
B = gammaCorrect(B);
|
|
262
|
-
return {
|
|
263
|
-
r: Math.round(Math.max(0, Math.min(1, R)) * 255),
|
|
264
|
-
g: Math.round(Math.max(0, Math.min(1, G)) * 255),
|
|
265
|
-
b: Math.round(Math.max(0, Math.min(1, B)) * 255),
|
|
266
|
-
a: A
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
function _rgb2xyz(rgb) {
|
|
270
|
-
const { r, g, b, a = 1 } = rgb;
|
|
271
|
-
let R = Math.max(0, Math.min(1, r / 255));
|
|
272
|
-
let G = Math.max(0, Math.min(1, g / 255));
|
|
273
|
-
let B = Math.max(0, Math.min(1, b / 255));
|
|
274
|
-
const A = Math.max(0, Math.min(1, a));
|
|
275
|
-
const SRGB_THRESHOLD = 0.04045;
|
|
276
|
-
const SRGB_OFFSET = 0.055;
|
|
277
|
-
const SRGB_DIVISOR = 1.055;
|
|
278
|
-
const SRGB_EXPONENT = 2.4;
|
|
279
|
-
const SRGB_LINEAR_DIVISOR = 12.92;
|
|
280
|
-
const linearize = (c) => c > SRGB_THRESHOLD ? Math.pow((c + SRGB_OFFSET) / SRGB_DIVISOR, SRGB_EXPONENT) : c / SRGB_LINEAR_DIVISOR;
|
|
281
|
-
R = linearize(R);
|
|
282
|
-
G = linearize(G);
|
|
283
|
-
B = linearize(B);
|
|
284
|
-
const X = R * 0.4124564 + G * 0.3575761 + B * 0.1804375;
|
|
285
|
-
const Y = R * 0.2126729 + G * 0.7151522 + B * 0.072175;
|
|
286
|
-
const Z = R * 0.0193339 + G * 0.119192 + B * 0.9503041;
|
|
287
|
-
return {
|
|
288
|
-
x: X * 100,
|
|
289
|
-
y: Y * 100,
|
|
290
|
-
z: Z * 100,
|
|
291
|
-
a: A
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
function _lab2xyz(lab) {
|
|
295
|
-
const { l, a: A = 0, b: B = 0, al: alpha = 1 } = lab;
|
|
296
|
-
const REF_X = 95.047;
|
|
297
|
-
const REF_Y = 100;
|
|
298
|
-
const REF_Z = 108.883;
|
|
299
|
-
const fy = (l + 16) / 116;
|
|
300
|
-
const fx = fy + A / 500;
|
|
301
|
-
const fz = fy - B / 200;
|
|
302
|
-
const fx3 = Math.pow(fx, 3);
|
|
303
|
-
const fz3 = Math.pow(fz, 3);
|
|
304
|
-
const fy3 = Math.pow(fy, 3);
|
|
305
|
-
const epsilon = 8856e-6;
|
|
306
|
-
const kappa = 903.3;
|
|
307
|
-
const X = fx3 > epsilon ? fx3 : (116 * fx - 16) / kappa;
|
|
308
|
-
const Y = l > kappa * epsilon ? fy3 : l / kappa;
|
|
309
|
-
const Z = fz3 > epsilon ? fz3 : (116 * fz - 16) / kappa;
|
|
310
|
-
return {
|
|
311
|
-
x: X * REF_X,
|
|
312
|
-
y: Y * REF_Y,
|
|
313
|
-
z: Z * REF_Z,
|
|
314
|
-
a: Math.max(0, Math.min(1, alpha))
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function _xyz2lab(xyza) {
|
|
318
|
-
const { x, y, z, a: alpha = 1 } = xyza;
|
|
319
|
-
const REF_X = 95.047;
|
|
320
|
-
const REF_Y = 100;
|
|
321
|
-
const REF_Z = 108.883;
|
|
322
|
-
const X = x / REF_X;
|
|
323
|
-
const Y = y / REF_Y;
|
|
324
|
-
const Z = z / REF_Z;
|
|
325
|
-
const epsilon = 8856e-6;
|
|
326
|
-
const kappa = 903.3;
|
|
327
|
-
const fx = X > epsilon ? Math.cbrt(X) : (kappa * X + 16) / 116;
|
|
328
|
-
const fy = Y > epsilon ? Math.cbrt(Y) : (kappa * Y + 16) / 116;
|
|
329
|
-
const fz = Z > epsilon ? Math.cbrt(Z) : (kappa * Z + 16) / 116;
|
|
330
|
-
const L = 116 * fy - 16;
|
|
331
|
-
const A = 500 * (fx - fy);
|
|
332
|
-
const B = 200 * (fy - fz);
|
|
333
|
-
return {
|
|
334
|
-
l: L,
|
|
335
|
-
a: A,
|
|
336
|
-
b: B,
|
|
337
|
-
al: Math.max(0, Math.min(1, alpha))
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
function _lab2lch(lab) {
|
|
341
|
-
const { l, a, b, al = 1 } = lab;
|
|
342
|
-
const c = Math.sqrt(a * a + b * b);
|
|
343
|
-
let h = Math.atan2(b, a) * (180 / Math.PI);
|
|
344
|
-
if (h < 0) h += 360;
|
|
345
|
-
return { l, c, h, a: al };
|
|
346
|
-
}
|
|
347
|
-
function _lch2lab(lch) {
|
|
348
|
-
const { l, c, h, a = 1 } = lch;
|
|
349
|
-
const hRad = h * Math.PI / 180;
|
|
350
|
-
const A = c * Math.cos(hRad);
|
|
351
|
-
const B = c * Math.sin(hRad);
|
|
352
|
-
return { l, a: A, b: B, al: a };
|
|
353
|
-
}
|
|
354
|
-
function toRgb(color) {
|
|
355
|
-
if (isRgb(color)) return color;
|
|
356
|
-
if (isHsl(color)) return _hsl2rgb(color);
|
|
357
|
-
if (isHsb(color)) return _hsb2rgb(color);
|
|
358
|
-
if (isCmyk(color)) return _cmyk2rgb(color);
|
|
359
|
-
if (isCssColor(color)) return _css2rgb(color);
|
|
360
|
-
if (isHex(color)) return _hex2rgb(color);
|
|
361
|
-
if (isXyz(color)) return _xyz2rgb(color);
|
|
362
|
-
if (isLab(color)) return _xyz2rgb(_lab2xyz(color));
|
|
363
|
-
if (isLch(color)) return _xyz2rgb(_lab2xyz(_lch2lab(color)));
|
|
364
|
-
throw new Error(`Invalid color input: ${unknownToString(color)}`);
|
|
365
|
-
}
|
|
366
|
-
function toXyz(color) {
|
|
367
|
-
if (isXyz(color)) return color;
|
|
368
|
-
if (isLab(color)) return _lab2xyz(color);
|
|
369
|
-
if (isLch(color)) return _lab2xyz(_lch2lab(color));
|
|
370
|
-
if (isRgb(color)) return _rgb2xyz(color);
|
|
371
|
-
if (isHsl(color)) return _rgb2xyz(_hsl2rgb(color));
|
|
372
|
-
if (isHsb(color)) return _rgb2xyz(_hsb2rgb(color));
|
|
373
|
-
if (isCmyk(color)) return _rgb2xyz(_cmyk2rgb(color));
|
|
374
|
-
if (isCssColor(color)) return _rgb2xyz(_css2rgb(color));
|
|
375
|
-
if (isHex(color)) return _rgb2xyz(_hex2rgb(color));
|
|
376
|
-
throw new Error(`Invalid color input: ${unknownToString(color)}`);
|
|
377
|
-
}
|
|
378
|
-
function toLab(color) {
|
|
379
|
-
if (isLab(color)) return color;
|
|
380
|
-
if (isLch(color)) return _lch2lab(color);
|
|
381
|
-
const xyzColor = toXyz(color);
|
|
382
|
-
return _xyz2lab(xyzColor);
|
|
383
|
-
}
|
|
384
|
-
function toLch(color) {
|
|
385
|
-
if (isLch(color)) return color;
|
|
386
|
-
const labColor = toLab(color);
|
|
387
|
-
return _lab2lch(labColor);
|
|
388
|
-
}
|
|
389
|
-
function toHsl(color) {
|
|
390
|
-
if (isHsl(color)) return color;
|
|
391
|
-
const rgbColor = toRgb(color);
|
|
392
|
-
return _rgb2hsl(rgbColor);
|
|
393
|
-
}
|
|
394
|
-
function toHsb(color) {
|
|
395
|
-
if (isHsb(color)) return color;
|
|
396
|
-
const rgbColor = toRgb(color);
|
|
397
|
-
return _rgb2hsb(rgbColor);
|
|
398
|
-
}
|
|
399
|
-
function toCmyk(color) {
|
|
400
|
-
if (isCmyk(color)) return color;
|
|
401
|
-
const rgbColor = toRgb(color);
|
|
402
|
-
return _rgb2cmyk(rgbColor);
|
|
403
|
-
}
|
|
404
|
-
function toCss(color) {
|
|
405
|
-
if (isCssColor(color)) return color;
|
|
406
|
-
const rgbColor = toRgb(color);
|
|
407
|
-
return _rgb2css(rgbColor);
|
|
408
|
-
}
|
|
409
|
-
function toHex(color) {
|
|
410
|
-
if (isHex(color)) return color;
|
|
411
|
-
const rgbColor = toRgb(color);
|
|
412
|
-
return _rgb2hex(rgbColor);
|
|
413
|
-
}
|
|
414
|
-
function viaRgb(color, transformer) {
|
|
415
|
-
const _color = color;
|
|
416
|
-
const rgb = toRgb(_color);
|
|
417
|
-
const transformedRgb = transformer(rgb);
|
|
418
|
-
if (isRgb(_color)) return transformedRgb;
|
|
419
|
-
if (isHsl(_color)) return toHsl(transformedRgb);
|
|
420
|
-
if (isHsb(_color)) return toHsb(transformedRgb);
|
|
421
|
-
if (isCmyk(_color)) return toCmyk(transformedRgb);
|
|
422
|
-
if (isXyz(_color)) return toXyz(transformedRgb);
|
|
423
|
-
if (isLab(_color)) return toLab(transformedRgb);
|
|
424
|
-
if (isLch(_color)) return toLch(transformedRgb);
|
|
425
|
-
if (isHex(_color)) return toRgb(transformedRgb);
|
|
426
|
-
if (isCssColor(_color)) return transformedRgb;
|
|
427
|
-
const _typecheck = true;
|
|
428
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
429
|
-
}
|
|
430
|
-
function viaHsl(color, transformer) {
|
|
431
|
-
const _color = color;
|
|
432
|
-
const hsl = toHsl(_color);
|
|
433
|
-
const transformedHsl = transformer(hsl);
|
|
434
|
-
if (isHsl(_color)) return transformedHsl;
|
|
435
|
-
if (isRgb(_color)) return toRgb(transformedHsl);
|
|
436
|
-
if (isHsb(_color)) return toHsb(transformedHsl);
|
|
437
|
-
if (isCmyk(_color)) return toCmyk(transformedHsl);
|
|
438
|
-
if (isXyz(_color)) return toXyz(transformedHsl);
|
|
439
|
-
if (isLab(_color)) return toLab(transformedHsl);
|
|
440
|
-
if (isLch(_color)) return toLch(transformedHsl);
|
|
441
|
-
if (isHex(_color)) return toHex(transformedHsl);
|
|
442
|
-
if (isCssColor(_color)) return transformedHsl;
|
|
443
|
-
const _typecheck = true;
|
|
444
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
445
|
-
}
|
|
446
|
-
function viaHsb(color, transformer) {
|
|
447
|
-
const _color = color;
|
|
448
|
-
const hsb = toHsb(_color);
|
|
449
|
-
const transformedHsb = transformer(hsb);
|
|
450
|
-
if (isHsb(_color)) return transformedHsb;
|
|
451
|
-
if (isRgb(_color)) return toRgb(transformedHsb);
|
|
452
|
-
if (isHsl(_color)) return toHsl(transformedHsb);
|
|
453
|
-
if (isCmyk(_color)) return toCmyk(transformedHsb);
|
|
454
|
-
if (isXyz(_color)) return toXyz(transformedHsb);
|
|
455
|
-
if (isLab(_color)) return toLab(transformedHsb);
|
|
456
|
-
if (isLch(_color)) return toLch(transformedHsb);
|
|
457
|
-
if (isHex(_color)) return toHex(transformedHsb);
|
|
458
|
-
if (isCssColor(_color)) return transformedHsb;
|
|
459
|
-
const _typecheck = true;
|
|
460
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
461
|
-
}
|
|
462
|
-
function viaCmyk(color, transformer) {
|
|
463
|
-
const _color = color;
|
|
464
|
-
const cmyk = toCmyk(_color);
|
|
465
|
-
const transformedCmyk = transformer(cmyk);
|
|
466
|
-
if (isHsb(_color)) return transformedCmyk;
|
|
467
|
-
if (isRgb(_color)) return toRgb(transformedCmyk);
|
|
468
|
-
if (isHsl(_color)) return toHsl(transformedCmyk);
|
|
469
|
-
if (isCmyk(_color)) return toCmyk(transformedCmyk);
|
|
470
|
-
if (isXyz(_color)) return toXyz(transformedCmyk);
|
|
471
|
-
if (isLab(_color)) return toLab(transformedCmyk);
|
|
472
|
-
if (isLch(_color)) return toLch(transformedCmyk);
|
|
473
|
-
if (isHex(_color)) return toHex(transformedCmyk);
|
|
474
|
-
if (isCssColor(_color)) return transformedCmyk;
|
|
475
|
-
const _typecheck = true;
|
|
476
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
477
|
-
}
|
|
478
|
-
function viaXyz(color, transformer) {
|
|
479
|
-
const _color = color;
|
|
480
|
-
const xyz = toXyz(_color);
|
|
481
|
-
const transformedXyz = transformer(xyz);
|
|
482
|
-
if (isHsb(_color)) return transformedXyz;
|
|
483
|
-
if (isRgb(_color)) return toRgb(transformedXyz);
|
|
484
|
-
if (isHsl(_color)) return toHsl(transformedXyz);
|
|
485
|
-
if (isCmyk(_color)) return toCmyk(transformedXyz);
|
|
486
|
-
if (isXyz(_color)) return toXyz(transformedXyz);
|
|
487
|
-
if (isLab(_color)) return toLab(transformedXyz);
|
|
488
|
-
if (isLch(_color)) return toLch(transformedXyz);
|
|
489
|
-
if (isHex(_color)) return toHex(transformedXyz);
|
|
490
|
-
if (isCssColor(_color)) return transformedXyz;
|
|
491
|
-
const _typecheck = true;
|
|
492
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
493
|
-
}
|
|
494
|
-
function viaLab(color, transformer) {
|
|
495
|
-
const _color = color;
|
|
496
|
-
const lab = toLab(_color);
|
|
497
|
-
const transformedLab = transformer(lab);
|
|
498
|
-
if (isHsb(_color)) return transformedLab;
|
|
499
|
-
if (isRgb(_color)) return toRgb(transformedLab);
|
|
500
|
-
if (isHsl(_color)) return toHsl(transformedLab);
|
|
501
|
-
if (isCmyk(_color)) return toCmyk(transformedLab);
|
|
502
|
-
if (isXyz(_color)) return toXyz(transformedLab);
|
|
503
|
-
if (isLab(_color)) return toLab(transformedLab);
|
|
504
|
-
if (isLch(_color)) return toLch(transformedLab);
|
|
505
|
-
if (isHex(_color)) return toHex(transformedLab);
|
|
506
|
-
if (isCssColor(_color)) return transformedLab;
|
|
507
|
-
const _typecheck = true;
|
|
508
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
509
|
-
}
|
|
510
|
-
function viaLch(color, transformer) {
|
|
511
|
-
const _color = color;
|
|
512
|
-
const lch = toLch(_color);
|
|
513
|
-
const transformedLch = transformer(lch);
|
|
514
|
-
if (isHsb(_color)) return transformedLch;
|
|
515
|
-
if (isRgb(_color)) return toRgb(transformedLch);
|
|
516
|
-
if (isHsl(_color)) return toHsl(transformedLch);
|
|
517
|
-
if (isCmyk(_color)) return toCmyk(transformedLch);
|
|
518
|
-
if (isXyz(_color)) return toXyz(transformedLch);
|
|
519
|
-
if (isLab(_color)) return toLab(transformedLch);
|
|
520
|
-
if (isLch(_color)) return toLch(transformedLch);
|
|
521
|
-
if (isHex(_color)) return toHex(transformedLch);
|
|
522
|
-
if (isCssColor(_color)) return transformedLch;
|
|
523
|
-
const _typecheck = true;
|
|
524
|
-
throw new Error(`Invalid color input: ${unknownToString(_color)}`);
|
|
525
|
-
}
|
|
526
|
-
function linearizeToSRgb(rgb) {
|
|
527
|
-
const cleanRgb = tidy(rgb);
|
|
528
|
-
const linearChannel = (v) => {
|
|
529
|
-
const n = v / 255;
|
|
530
|
-
if (n <= 0.04045) return n / 12.92;
|
|
531
|
-
else return Math.pow((n + 0.055) / 1.055, 2.4);
|
|
532
|
-
};
|
|
533
|
-
return {
|
|
534
|
-
linearR: linearChannel(cleanRgb.r),
|
|
535
|
-
linearG: linearChannel(cleanRgb.g),
|
|
536
|
-
linearB: linearChannel(cleanRgb.b),
|
|
537
|
-
a: cleanRgb.a
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
function delinearizeToRgb(srgb) {
|
|
541
|
-
const gammaChannel = (v) => {
|
|
542
|
-
if (v <= 31308e-7) return v * 12.92;
|
|
543
|
-
else return 1.055 * Math.pow(v, 1 / 2.4) - 0.055;
|
|
544
|
-
};
|
|
545
|
-
return tidy({
|
|
546
|
-
r: gammaChannel(srgb.linearR) * 255,
|
|
547
|
-
g: gammaChannel(srgb.linearG) * 255,
|
|
548
|
-
b: gammaChannel(srgb.linearB) * 255,
|
|
549
|
-
a: srgb.a
|
|
550
|
-
});
|
|
551
|
-
}
|
|
2
|
+
delinearizeToRgb,
|
|
3
|
+
linearizeToSRgb,
|
|
4
|
+
toCmyk,
|
|
5
|
+
toCss,
|
|
6
|
+
toHex,
|
|
7
|
+
toHsb,
|
|
8
|
+
toHsl,
|
|
9
|
+
toLab,
|
|
10
|
+
toLch,
|
|
11
|
+
toRgb,
|
|
12
|
+
toXyz,
|
|
13
|
+
viaCmyk,
|
|
14
|
+
viaHsb,
|
|
15
|
+
viaHsl,
|
|
16
|
+
viaLab,
|
|
17
|
+
viaLch,
|
|
18
|
+
viaRgb,
|
|
19
|
+
viaXyz
|
|
20
|
+
} from "../../../chunks/chunk-CVMYA5XK.js";
|
|
21
|
+
import "../../../chunks/chunk-OBSTP7YR.js";
|
|
22
|
+
import "../../../chunks/chunk-DNIOWD7K.js";
|
|
23
|
+
import "../../../chunks/chunk-HQLRJ7XW.js";
|
|
24
|
+
import "../../../chunks/chunk-PUQUSA6S.js";
|
|
25
|
+
import "../../../chunks/chunk-OSAXBA7G.js";
|
|
26
|
+
import "../../../chunks/chunk-WSFCRVEQ.js";
|
|
552
27
|
export {
|
|
553
28
|
delinearizeToRgb,
|
|
554
29
|
linearizeToSRgb,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toLab
|
|
3
|
+
} from "../../../chunks/chunk-CVMYA5XK.js";
|
|
4
|
+
import "../../../chunks/chunk-OBSTP7YR.js";
|
|
5
|
+
import "../../../chunks/chunk-DNIOWD7K.js";
|
|
6
|
+
import "../../../chunks/chunk-HQLRJ7XW.js";
|
|
7
|
+
import "../../../chunks/chunk-PUQUSA6S.js";
|
|
8
|
+
import "../../../chunks/chunk-OSAXBA7G.js";
|
|
9
|
+
import "../../../chunks/chunk-WSFCRVEQ.js";
|
|
10
|
+
|
|
1
11
|
// src/agnostic/colors/distance/index.ts
|
|
2
|
-
import { toLab } from "../convert/index.js";
|
|
3
12
|
function distanceCiede2000(c1, c2) {
|
|
4
13
|
const deg2rad = (deg) => Math.PI / 180 * deg;
|
|
5
14
|
const rad2deg = (rad) => 180 / Math.PI * rad;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
// src/agnostic/colors/grayscale/index.ts
|
|
2
1
|
import {
|
|
3
|
-
viaRgb,
|
|
4
2
|
viaCmyk,
|
|
5
|
-
viaHsl,
|
|
6
3
|
viaHsb,
|
|
7
|
-
|
|
4
|
+
viaHsl,
|
|
8
5
|
viaLab,
|
|
9
|
-
viaLch
|
|
10
|
-
|
|
6
|
+
viaLch,
|
|
7
|
+
viaRgb,
|
|
8
|
+
viaXyz
|
|
9
|
+
} from "../../../chunks/chunk-CVMYA5XK.js";
|
|
10
|
+
import "../../../chunks/chunk-OBSTP7YR.js";
|
|
11
|
+
import "../../../chunks/chunk-DNIOWD7K.js";
|
|
12
|
+
import "../../../chunks/chunk-HQLRJ7XW.js";
|
|
13
|
+
import "../../../chunks/chunk-PUQUSA6S.js";
|
|
14
|
+
import "../../../chunks/chunk-OSAXBA7G.js";
|
|
15
|
+
import "../../../chunks/chunk-WSFCRVEQ.js";
|
|
16
|
+
|
|
17
|
+
// src/agnostic/colors/grayscale/index.ts
|
|
11
18
|
function avgGrayscaleRgb(rgb) {
|
|
12
19
|
const { r, g, b } = rgb;
|
|
13
20
|
const avg = (r + g + b) / 3;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as channels from './channels/index.js'
|
|
2
2
|
export * as contrast from './contrast/index.js'
|
|
3
|
-
export * as
|
|
3
|
+
export * as convert from './convert/index.js'
|
|
4
4
|
export * as grayscale from './grayscale/index.js'
|
|
5
|
+
export * as distance from './distance/index.js'
|
|
5
6
|
export * as invert from './invert/index.js'
|
|
6
7
|
export * as lerp from './lerp/index.js'
|
|
7
8
|
export * as luminance from './luminance/index.js'
|
|
8
9
|
export * as palette from './palette/index.js'
|
|
9
|
-
export * as convert from './convert/index.js'
|
|
10
|
-
export * as tidy from './tidy/index.js'
|
|
11
10
|
export * as rotate from './rotate/index.js'
|
|
11
|
+
export * as tidy from './tidy/index.js'
|
|
12
12
|
export * as typechecks from './typechecks/index.js'
|
package/agnostic/colors/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as channels from './channels/index.js'
|
|
2
2
|
export * as contrast from './contrast/index.js'
|
|
3
|
-
export * as
|
|
3
|
+
export * as convert from './convert/index.js'
|
|
4
4
|
export * as grayscale from './grayscale/index.js'
|
|
5
|
+
export * as distance from './distance/index.js'
|
|
5
6
|
export * as invert from './invert/index.js'
|
|
6
7
|
export * as lerp from './lerp/index.js'
|
|
7
8
|
export * as luminance from './luminance/index.js'
|
|
8
9
|
export * as palette from './palette/index.js'
|
|
9
|
-
export * as convert from './convert/index.js'
|
|
10
|
-
export * as tidy from './tidy/index.js'
|
|
11
10
|
export * as rotate from './rotate/index.js'
|
|
11
|
+
export * as tidy from './tidy/index.js'
|
|
12
12
|
export * as typechecks from './typechecks/index.js'
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
viaLab,
|
|
3
|
+
viaLch,
|
|
4
|
+
viaRgb
|
|
5
|
+
} from "../../../chunks/chunk-CVMYA5XK.js";
|
|
6
|
+
import "../../../chunks/chunk-OBSTP7YR.js";
|
|
7
|
+
import {
|
|
8
|
+
absoluteModulo
|
|
9
|
+
} from "../../../chunks/chunk-DNIOWD7K.js";
|
|
10
|
+
import "../../../chunks/chunk-HQLRJ7XW.js";
|
|
11
|
+
import "../../../chunks/chunk-PUQUSA6S.js";
|
|
12
|
+
import "../../../chunks/chunk-OSAXBA7G.js";
|
|
13
|
+
import "../../../chunks/chunk-WSFCRVEQ.js";
|
|
14
|
+
|
|
1
15
|
// src/agnostic/colors/invert/index.ts
|
|
2
|
-
import { viaRgb, viaLab, viaLch } from "../convert/index.js";
|
|
3
|
-
import { absoluteModulo } from "../../numbers/absolute-modulo/index.js";
|
|
4
16
|
function invertRgb(color) {
|
|
5
17
|
return viaRgb(color, (rgb) => ({
|
|
6
18
|
...rgb,
|