@livechart/sharp-vibrant 0.1.0 → 0.2.1
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/.eslintcache +1 -1
- package/.vscode/settings.json +1 -1
- package/README.md +22 -9
- package/fixtures/sample/images/palettes.json +16 -0
- package/fixtures/sample/types.ts +8 -4
- package/lib/builder.d.ts +2 -4
- package/lib/builder.js +31 -41
- package/lib/builder.js.map +1 -1
- package/lib/color.d.ts +1 -1
- package/lib/color.js +46 -51
- package/lib/color.js.map +1 -1
- package/lib/filter/default.js +1 -4
- package/lib/filter/default.js.map +1 -1
- package/lib/filter/index.js +2 -6
- package/lib/filter/index.js.map +1 -1
- package/lib/generator/default.js +12 -14
- package/lib/generator/default.js.map +1 -1
- package/lib/generator/index.js +2 -7
- package/lib/generator/index.js.map +1 -1
- package/lib/image/base.d.ts +2 -0
- package/lib/image/base.js +1 -3
- package/lib/image/base.js.map +1 -1
- package/lib/image/sharp.d.ts +2 -0
- package/lib/image/sharp.js +35 -28
- package/lib/image/sharp.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -8
- package/lib/index.js.map +1 -1
- package/lib/quantizer/index.js +2 -7
- package/lib/quantizer/index.js.map +1 -1
- package/lib/quantizer/mmcq.js +8 -13
- package/lib/quantizer/mmcq.js.map +1 -1
- package/lib/quantizer/pqueue.js +23 -27
- package/lib/quantizer/pqueue.js.map +1 -1
- package/lib/quantizer/vbox.js +51 -55
- package/lib/quantizer/vbox.js.map +1 -1
- package/lib/src/builder.d.ts +17 -0
- package/lib/src/builder.js +80 -0
- package/lib/src/builder.js.map +1 -0
- package/lib/src/color.d.ts +30 -0
- package/lib/src/color.js +81 -0
- package/lib/src/color.js.map +1 -0
- package/lib/src/filter/default.d.ts +1 -0
- package/lib/src/filter/default.js +7 -0
- package/lib/src/filter/default.js.map +1 -0
- package/lib/src/filter/index.d.ts +3 -0
- package/lib/src/filter/index.js +24 -0
- package/lib/src/filter/index.js.map +1 -0
- package/lib/src/generator/default.d.ts +20 -0
- package/lib/src/generator/default.js +143 -0
- package/lib/src/generator/default.js.map +1 -0
- package/lib/src/generator/index.d.ts +3 -0
- package/lib/src/generator/index.js +9 -0
- package/lib/src/generator/index.js.map +1 -0
- package/lib/src/image/base.d.ts +11 -0
- package/lib/src/image/base.js +29 -0
- package/lib/src/image/base.js.map +1 -0
- package/lib/src/image/sharp.d.ts +11 -0
- package/lib/src/image/sharp.js +81 -0
- package/lib/src/image/sharp.js.map +1 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.js +9 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/quantizer/index.d.ts +2 -0
- package/lib/src/quantizer/index.js +8 -0
- package/lib/src/quantizer/index.js.map +1 -0
- package/lib/src/quantizer/mmcq.d.ts +3 -0
- package/lib/src/quantizer/mmcq.js +57 -0
- package/lib/src/quantizer/mmcq.js.map +1 -0
- package/lib/src/quantizer/pqueue.d.ts +14 -0
- package/lib/src/quantizer/pqueue.js +51 -0
- package/lib/src/quantizer/pqueue.js.map +1 -0
- package/lib/src/quantizer/vbox.d.ts +26 -0
- package/lib/src/quantizer/vbox.js +253 -0
- package/lib/src/quantizer/vbox.js.map +1 -0
- package/lib/src/typing.d.ts +57 -0
- package/lib/src/typing.js +3 -0
- package/lib/src/typing.js.map +1 -0
- package/lib/src/util.d.ts +31 -0
- package/lib/src/util.js +201 -0
- package/lib/src/util.js.map +1 -0
- package/lib/src/vibrant.d.ts +21 -0
- package/lib/src/vibrant.js +117 -0
- package/lib/src/vibrant.js.map +1 -0
- package/lib/typing.d.ts +18 -10
- package/lib/typing.js +1 -2
- package/lib/util.js +22 -37
- package/lib/util.js.map +1 -1
- package/lib/vibrant.d.ts +3 -4
- package/lib/vibrant.js +42 -52
- package/lib/vibrant.js.map +1 -1
- package/package.json +8 -8
- package/src/builder.ts +2 -6
- package/src/image/base.ts +4 -0
- package/src/image/sharp.ts +18 -3
- package/src/index.ts +1 -1
- package/src/test/common/data.ts +3 -1
- package/src/test/common/helper.ts +41 -21
- package/src/test/vibrant.spec.ts +4 -2
- package/src/typing.ts +19 -7
- package/src/vibrant.ts +16 -10
- package/tsconfig.json +4 -14
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/node_vibrant/fixtures/sample/types.ts":"1","/node_vibrant/src/builder.ts":"2","/node_vibrant/src/color.ts":"3","/node_vibrant/src/filter/default.ts":"4","/node_vibrant/src/filter/index.ts":"5","/node_vibrant/src/generator/default.ts":"6","/node_vibrant/src/generator/index.ts":"7","/node_vibrant/src/image/base.ts":"8","/node_vibrant/src/image/sharp.ts":"9","/node_vibrant/src/index.ts":"10","/node_vibrant/src/quantizer/index.ts":"11","/node_vibrant/src/quantizer/mmcq.ts":"12","/node_vibrant/src/quantizer/pqueue.ts":"13","/node_vibrant/src/quantizer/vbox.ts":"14","/node_vibrant/src/test/builder.spec.ts":"15","/node_vibrant/src/test/common/data.ts":"16","/node_vibrant/src/test/common/helper.ts":"17","/node_vibrant/src/test/vibrant.spec.ts":"18","/node_vibrant/src/typing.ts":"19","/node_vibrant/src/util.ts":"20","/node_vibrant/src/vibrant.ts":"21","/node_vibrant/lib/builder.d.ts":"22","/node_vibrant/lib/builder.js":"23","/node_vibrant/lib/color.d.ts":"24","/node_vibrant/lib/color.js":"25","/node_vibrant/lib/filter/default.d.ts":"26","/node_vibrant/lib/filter/default.js":"27","/node_vibrant/lib/filter/index.d.ts":"28","/node_vibrant/lib/filter/index.js":"29","/node_vibrant/lib/generator/default.d.ts":"30","/node_vibrant/lib/generator/default.js":"31","/node_vibrant/lib/generator/index.d.ts":"32","/node_vibrant/lib/generator/index.js":"33","/node_vibrant/lib/image/base.d.ts":"34","/node_vibrant/lib/image/base.js":"35","/node_vibrant/lib/image/sharp.d.ts":"36","/node_vibrant/lib/image/sharp.js":"37","/node_vibrant/lib/index.d.ts":"38","/node_vibrant/lib/index.js":"39","/node_vibrant/lib/quantizer/index.d.ts":"40","/node_vibrant/lib/quantizer/index.js":"41","/node_vibrant/lib/quantizer/mmcq.d.ts":"42","/node_vibrant/lib/quantizer/mmcq.js":"43","/node_vibrant/lib/quantizer/pqueue.d.ts":"44","/node_vibrant/lib/quantizer/pqueue.js":"45","/node_vibrant/lib/quantizer/vbox.d.ts":"46","/node_vibrant/lib/quantizer/vbox.js":"47","/node_vibrant/lib/typing.d.ts":"48","/node_vibrant/lib/typing.js":"49","/node_vibrant/lib/util.d.ts":"50","/node_vibrant/lib/util.js":"51","/node_vibrant/lib/vibrant.d.ts":"52","/node_vibrant/lib/vibrant.js":"53"},{"size":238,"mtime":1588446397444,"results":"54","hashOfConfig":"55"},{"size":1781,"mtime":1588512490019,"results":"56","hashOfConfig":"57"},{"size":1942,"mtime":1588506946248,"results":"58","hashOfConfig":"57"},{"size":161,"mtime":1588503588651,"results":"59","hashOfConfig":"57"},{"size":465,"mtime":1588506456241,"results":"60","hashOfConfig":"57"},{"size":8317,"mtime":1588518071602,"results":"61","hashOfConfig":"57"},{"size":109,"mtime":1588518456074,"results":"62","hashOfConfig":"57"},{"size":964,"mtime":1588506572228,"results":"63","hashOfConfig":"57"},{"size":1159,"mtime":1588506424802,"results":"64","hashOfConfig":"57"},{"size":138,"mtime":1588505439444,"results":"65","hashOfConfig":"57"},{"size":49,"mtime":1588518729083,"results":"66","hashOfConfig":"57"},{"size":1643,"mtime":1588518668836,"results":"67","hashOfConfig":"57"},{"size":915,"mtime":1588508311698,"results":"68","hashOfConfig":"57"},{"size":6820,"mtime":1588517843664,"results":"69","hashOfConfig":"57"},{"size":886,"mtime":1588503314318,"results":"70","hashOfConfig":"71"},{"size":524,"mtime":1588505107783,"results":"72","hashOfConfig":"71"},{"size":3136,"mtime":1588503422805,"results":"73","hashOfConfig":"71"},{"size":480,"mtime":1588491662415,"results":"74","hashOfConfig":"71"},{"size":1329,"mtime":1588511647128,"results":"75","hashOfConfig":"57"},{"size":5530,"mtime":1588514247928,"results":"76","hashOfConfig":"57"},{"size":2180,"mtime":1588519274754,"results":"77","hashOfConfig":"57"},{"size":792,"mtime":1588516999353,"results":"78","hashOfConfig":"55"},{"size":2867,"mtime":1588516999353,"results":"79","hashOfConfig":"55"},{"size":778,"mtime":1588516999217,"results":"80","hashOfConfig":"55"},{"size":3366,"mtime":1588516999213,"results":"81","hashOfConfig":"55"},{"size":92,"mtime":1588516999325,"results":"82","hashOfConfig":"55"},{"size":241,"mtime":1588516999321,"results":"83","hashOfConfig":"55"},{"size":163,"mtime":1588516999325,"results":"84","hashOfConfig":"55"},{"size":601,"mtime":1588516999325,"results":"85","hashOfConfig":"55"},{"size":592,"mtime":1588516999317,"results":"86","hashOfConfig":"55"},{"size":7439,"mtime":1588516999313,"results":"87","hashOfConfig":"55"},{"size":48,"mtime":1588516999321,"results":"88","hashOfConfig":"55"},{"size":185,"mtime":1588516999321,"results":"89","hashOfConfig":"55"},{"size":420,"mtime":1588516999361,"results":"90","hashOfConfig":"55"},{"size":881,"mtime":1588516999357,"results":"91","hashOfConfig":"55"},{"size":330,"mtime":1588516999373,"results":"92","hashOfConfig":"55"},{"size":2968,"mtime":1588516999373,"results":"93","hashOfConfig":"55"},{"size":51,"mtime":1588516999377,"results":"94","hashOfConfig":"55"},{"size":398,"mtime":1588516999377,"results":"95","hashOfConfig":"55"},{"size":42,"mtime":1588516999293,"results":"96","hashOfConfig":"55"},{"size":173,"mtime":1588516999289,"results":"97","hashOfConfig":"55"},{"size":187,"mtime":1588516999289,"results":"98","hashOfConfig":"55"},{"size":1909,"mtime":1588516999289,"results":"99","hashOfConfig":"55"},{"size":353,"mtime":1588516999281,"results":"100","hashOfConfig":"55"},{"size":1731,"mtime":1588516999281,"results":"101","hashOfConfig":"55"},{"size":682,"mtime":1588516999273,"results":"102","hashOfConfig":"55"},{"size":8712,"mtime":1588516999273,"results":"103","hashOfConfig":"55"},{"size":1443,"mtime":1588516999229,"results":"104","hashOfConfig":"55"},{"size":111,"mtime":1588516999221,"results":"105","hashOfConfig":"55"},{"size":1384,"mtime":1588516999197,"results":"106","hashOfConfig":"55"},{"size":5719,"mtime":1588516999185,"results":"107","hashOfConfig":"55"},{"size":891,"mtime":1588516999345,"results":"108","hashOfConfig":"55"},{"size":3231,"mtime":1588516999341,"results":"109","hashOfConfig":"55"},{"filePath":"110","messages":"111","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"11utqc",{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1vz5ia3",{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"140"},"1261f3q",{"filePath":"141","messages":"142","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"143"},{"filePath":"144","messages":"145","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"146"},{"filePath":"147","messages":"148","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"149"},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"158","messages":"159","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"160","messages":"161","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"162","messages":"163","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"164","messages":"165","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"166","messages":"167","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"168","messages":"169","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"170","messages":"171","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"172","messages":"173","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"174","messages":"175","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"176","messages":"177","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"178","messages":"179","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"180","messages":"181","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"182","messages":"183","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"184","messages":"185","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"186","messages":"187","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"188","messages":"189","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"190","messages":"191","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"192","messages":"193","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"194","messages":"195","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"196","messages":"197","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"198","messages":"199","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"200","messages":"201","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"202","messages":"203","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"204","messages":"205","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"206","messages":"207","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"208","messages":"209","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"210","messages":"211","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"212","messages":"213","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"214","messages":"215","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"216","messages":"217","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"218","messages":"219","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/node_vibrant/fixtures/sample/types.ts",["220"],"/node_vibrant/src/builder.ts",[],"/node_vibrant/src/color.ts",[],"/node_vibrant/src/filter/default.ts",[],"/node_vibrant/src/filter/index.ts",[],"/node_vibrant/src/generator/default.ts",[],"/node_vibrant/src/generator/index.ts",[],"/node_vibrant/src/image/base.ts",[],"/node_vibrant/src/image/sharp.ts",[],"/node_vibrant/src/index.ts",[],"/node_vibrant/src/quantizer/index.ts",[],"/node_vibrant/src/quantizer/mmcq.ts",[],"/node_vibrant/src/quantizer/pqueue.ts",[],"/node_vibrant/src/quantizer/vbox.ts",[],"/node_vibrant/src/test/builder.spec.ts",["221"],"/* eslint-env mocha */\nimport { expect } from 'chai'\n\nimport Vibrant = require('../index')\n\nimport omit = require('lodash/omit')\n\ndescribe('builder', () => {\n it('modifies Vibrant options', () => {\n const NOT_A_FILTER = () => { }\n let v = Vibrant.from('NOT_A_PATH')\n .maxColorCount(23)\n .quality(7)\n .useImageClass(<any>'NOT_AN_IMAGE')\n .useGenerator(<any>'NOT_A_GENERATOR')\n .useQuantizer(<any>'NOT_A_QUANTIZER')\n .clearFilters()\n .addFilter(<any>NOT_A_FILTER)\n .build()\n const expected = {\n colorCount: 23,\n quality: 7,\n ImageClass: 'NOT_AN_IMAGE',\n quantizer: 'NOT_A_QUANTIZER',\n generator: 'NOT_A_GENERATOR',\n filters: [NOT_A_FILTER]\n }\n\n expect(v.opts.combinedFilter, 'should have combined filter').to.be.a('function')\n\n expect(omit(v.opts, 'combinedFilter')).to.deep.equal(expected)\n })\n})\n","/node_vibrant/src/test/common/data.ts",["222"],"import path from 'path';\n\nimport { Sample } from '../../../fixtures/sample/types'\nexport const SNAPSHOT: Sample[] = require('../../../fixtures/sample/images/palettes.json')\n\nexport interface TestSample extends Sample {\n relativeUrl: string\n}\n\nexport type SamplePathKey = Exclude<keyof TestSample, 'palettes'>\n\nexport const SAMPLES: TestSample[] = SNAPSHOT.map((s) => Object.assign(s, {\n filePath: path.join(__dirname, '../../../fixtures/sample/images/', s.name),\n relativeUrl: `base/fixtures/sample/images/${s.name}`\n}))\n","/node_vibrant/src/test/common/helper.ts",["223"],"/* eslint-env mocha */\nimport { expect } from 'chai'\nimport { VibrantStatic } from '../../typing'\nimport Builder from '../../builder'\nimport { Palette, Swatch } from '../../color'\nimport util = require('../../util')\nimport {\n TestSample, SamplePathKey\n} from './data'\n\nimport { table, getBorderCharacters } from 'table'\n\n\nconst TABLE_OPTS = {\n border: getBorderCharacters('void')\n}\n\n\nconst displayColorDiffTable = (diff: string[][]) => {\n console.log(table(diff, TABLE_OPTS))\n}\n\nconst assertPalette = (reference: Palette, palette: Palette) => {\n expect(palette, 'palette should be returned').not.to.be.null\n\n let failCount = 0\n const compare = (name: string, expected: Swatch, actual: Swatch) => {\n let result = {\n status: 'N/A',\n diff: -1\n }\n\n if (expected === null) {\n if (actual !== null) {\n console.warn(`WARN: ${name} color was not expected. Got ${actual.getHex()}`)\n }\n } else {\n expect(actual, `${name} color was expected`).not.to.be.null\n let diff = util.rgbDiff(actual.rgb, expected.rgb)\n result.diff = diff\n result.status = util.getColorDiffStatus(diff)\n if (diff > util.DELTAE94_DIFF_STATUS.SIMILAR) { failCount++ }\n }\n\n return result\n }\n\n const names = Object.keys(palette)\n const nameRow = [''].concat(names)\n const actualRow = ['Actual']\n const expectedRow = ['Expected']\n const scoreRow = ['Score']\n for (const name of names) {\n const actual = palette[name]\n const expected = reference[name]\n actualRow.push(actual ? actual.hex : null!)\n expectedRow.push(expected ? util.rgbToHex(...expected.rgb) : null!)\n const r = compare(name, expected!, actual!)\n scoreRow.push(`${r.status}(${r.diff.toPrecision(2)})`)\n }\n\n // Display diff table only when necessary\n if (failCount > 0) {\n displayColorDiffTable([nameRow, actualRow, expectedRow, scoreRow])\n }\n\n expect(failCount, `${failCount} colors are too diffrent from reference palettes`)\n .to.equal(0)\n}\n\nconst paletteCallback = (references: any, sample: TestSample, done: Mocha.Done) =>\n (err?: Error, palette?: Palette) => {\n setTimeout(() => {\n\n expect(err, `should not throw error '${err}'`).to.be.null\n assertPalette(references, palette!)\n\n done()\n }, 0)\n }\n\nexport const testVibrant = (Vibrant: VibrantStatic, sample: TestSample, pathKey: SamplePathKey, env: 'node', builderCallback: (b: Builder) => Builder = null!) => {\n return (done: Mocha.Done) => {\n let builder = Vibrant.from(sample[pathKey])\n .quality(1)\n\n if (typeof builderCallback === 'function') builder = builderCallback(builder)\n\n builder.getPalette(paletteCallback(sample.palettes[env], sample, done))\n }\n}\n\n\nexport const testVibrantAsPromised = (Vibrant: VibrantStatic, sample: TestSample, pathKey: SamplePathKey, env: 'node', builderCallback: (b: Builder) => Builder = null!) => {\n return () => {\n let builder = Vibrant.from(sample[pathKey])\n .quality(1)\n\n if (typeof builderCallback === 'function') builder = builderCallback(builder)\n\n return builder.getPalette()\n .then(palette => assertPalette(sample.palettes[env], palette))\n }\n}\n","/node_vibrant/src/test/vibrant.spec.ts",["224"],"/* eslint-env mocha */\nimport {\n SAMPLES\n} from './common/data'\nimport {\n testVibrant,\n testVibrantAsPromised\n} from './common/helper'\n\nimport Vibrant = require('../')\n\ndescribe('Palette Extraction', () => {\n describe('process samples', () =>\n SAMPLES.forEach((sample) => {\n it(`${sample.name} (callback)`, testVibrant(Vibrant, sample, 'filePath', 'node'))\n it(`${sample.name} (Promise)`, testVibrantAsPromised(Vibrant, sample, 'filePath', 'node'))\n })\n )\n})\n","/node_vibrant/src/typing.ts",[],"/node_vibrant/src/util.ts",[],"/node_vibrant/src/vibrant.ts",[],"/node_vibrant/lib/builder.d.ts",["225"],"/node_vibrant/lib/builder.js",["226"],"/node_vibrant/lib/color.d.ts",["227"],"/node_vibrant/lib/color.js",["228"],"/node_vibrant/lib/filter/default.d.ts",["229"],"/node_vibrant/lib/filter/default.js",["230"],"/node_vibrant/lib/filter/index.d.ts",["231"],"/node_vibrant/lib/filter/index.js",["232"],"/node_vibrant/lib/generator/default.d.ts",["233"],"/node_vibrant/lib/generator/default.js",["234"],"/node_vibrant/lib/generator/index.d.ts",["235"],"/node_vibrant/lib/generator/index.js",["236"],"/node_vibrant/lib/image/base.d.ts",["237"],"/node_vibrant/lib/image/base.js",["238"],"/node_vibrant/lib/image/sharp.d.ts",["239"],"/node_vibrant/lib/image/sharp.js",["240"],"/node_vibrant/lib/index.d.ts",["241"],"/node_vibrant/lib/index.js",["242"],"/node_vibrant/lib/quantizer/index.d.ts",["243"],"/node_vibrant/lib/quantizer/index.js",["244"],"/node_vibrant/lib/quantizer/mmcq.d.ts",["245"],"/node_vibrant/lib/quantizer/mmcq.js",["246"],"/node_vibrant/lib/quantizer/pqueue.d.ts",["247"],"/node_vibrant/lib/quantizer/pqueue.js",["248"],"/node_vibrant/lib/quantizer/vbox.d.ts",["249"],"/node_vibrant/lib/quantizer/vbox.js",["250"],"/node_vibrant/lib/typing.d.ts",["251"],"/node_vibrant/lib/typing.js",["252"],"/node_vibrant/lib/util.d.ts",["253"],"/node_vibrant/lib/util.js",["254"],"/node_vibrant/lib/vibrant.d.ts",["255"],"/node_vibrant/lib/vibrant.js",["256"],{"ruleId":null,"fatal":true,"severity":2,"message":"257"},{"ruleId":null,"fatal":true,"severity":2,"message":"258"},{"ruleId":null,"fatal":true,"severity":2,"message":"259"},{"ruleId":null,"fatal":true,"severity":2,"message":"260"},{"ruleId":null,"fatal":true,"severity":2,"message":"261"},{"ruleId":null,"fatal":true,"severity":2,"message":"262"},{"ruleId":null,"fatal":true,"severity":2,"message":"263"},{"ruleId":null,"fatal":true,"severity":2,"message":"264"},{"ruleId":null,"fatal":true,"severity":2,"message":"265"},{"ruleId":null,"fatal":true,"severity":2,"message":"266"},{"ruleId":null,"fatal":true,"severity":2,"message":"267"},{"ruleId":null,"fatal":true,"severity":2,"message":"268"},{"ruleId":null,"fatal":true,"severity":2,"message":"269"},{"ruleId":null,"fatal":true,"severity":2,"message":"270"},{"ruleId":null,"fatal":true,"severity":2,"message":"271"},{"ruleId":null,"fatal":true,"severity":2,"message":"272"},{"ruleId":null,"fatal":true,"severity":2,"message":"273"},{"ruleId":null,"fatal":true,"severity":2,"message":"274"},{"ruleId":null,"fatal":true,"severity":2,"message":"275"},{"ruleId":null,"fatal":true,"severity":2,"message":"276"},{"ruleId":null,"fatal":true,"severity":2,"message":"277"},{"ruleId":null,"fatal":true,"severity":2,"message":"278"},{"ruleId":null,"fatal":true,"severity":2,"message":"279"},{"ruleId":null,"fatal":true,"severity":2,"message":"280"},{"ruleId":null,"fatal":true,"severity":2,"message":"281"},{"ruleId":null,"fatal":true,"severity":2,"message":"282"},{"ruleId":null,"fatal":true,"severity":2,"message":"283"},{"ruleId":null,"fatal":true,"severity":2,"message":"284"},{"ruleId":null,"fatal":true,"severity":2,"message":"285"},{"ruleId":null,"fatal":true,"severity":2,"message":"286"},{"ruleId":null,"fatal":true,"severity":2,"message":"287"},{"ruleId":null,"fatal":true,"severity":2,"message":"288"},{"ruleId":null,"fatal":true,"severity":2,"message":"289"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"291"},{"ruleId":null,"fatal":true,"severity":2,"message":"292"},{"ruleId":null,"fatal":true,"severity":2,"message":"293"},"Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: fixtures/sample/types.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: src/test/builder.spec.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: src/test/common/data.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: src/test/common/helper.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: src/test/vibrant.spec.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/builder.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/builder.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/color.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/color.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/default.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/default.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/default.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/default.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/base.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/base.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/sharp.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/sharp.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/mmcq.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/mmcq.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/pqueue.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/pqueue.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/vbox.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/vbox.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/typing.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/typing.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/util.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/util.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/vibrant.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/vibrant.js.\nThe file must be included in at least one of the projects provided."]
|
|
1
|
+
[{"/node_vibrant/fixtures/sample/types.ts":"1","/node_vibrant/src/builder.ts":"2","/node_vibrant/src/color.ts":"3","/node_vibrant/src/filter/default.ts":"4","/node_vibrant/src/filter/index.ts":"5","/node_vibrant/src/generator/default.ts":"6","/node_vibrant/src/generator/index.ts":"7","/node_vibrant/src/image/base.ts":"8","/node_vibrant/src/image/sharp.ts":"9","/node_vibrant/src/index.ts":"10","/node_vibrant/src/quantizer/index.ts":"11","/node_vibrant/src/quantizer/mmcq.ts":"12","/node_vibrant/src/quantizer/pqueue.ts":"13","/node_vibrant/src/quantizer/vbox.ts":"14","/node_vibrant/src/test/builder.spec.ts":"15","/node_vibrant/src/test/common/data.ts":"16","/node_vibrant/src/test/common/helper.ts":"17","/node_vibrant/src/test/vibrant.spec.ts":"18","/node_vibrant/src/typing.ts":"19","/node_vibrant/src/util.ts":"20","/node_vibrant/src/vibrant.ts":"21","/node_vibrant/lib/builder.d.ts":"22","/node_vibrant/lib/builder.js":"23","/node_vibrant/lib/color.d.ts":"24","/node_vibrant/lib/color.js":"25","/node_vibrant/lib/filter/default.d.ts":"26","/node_vibrant/lib/filter/default.js":"27","/node_vibrant/lib/filter/index.d.ts":"28","/node_vibrant/lib/filter/index.js":"29","/node_vibrant/lib/generator/default.d.ts":"30","/node_vibrant/lib/generator/default.js":"31","/node_vibrant/lib/generator/index.d.ts":"32","/node_vibrant/lib/generator/index.js":"33","/node_vibrant/lib/image/base.d.ts":"34","/node_vibrant/lib/image/base.js":"35","/node_vibrant/lib/image/sharp.d.ts":"36","/node_vibrant/lib/image/sharp.js":"37","/node_vibrant/lib/index.d.ts":"38","/node_vibrant/lib/index.js":"39","/node_vibrant/lib/quantizer/index.d.ts":"40","/node_vibrant/lib/quantizer/index.js":"41","/node_vibrant/lib/quantizer/mmcq.d.ts":"42","/node_vibrant/lib/quantizer/mmcq.js":"43","/node_vibrant/lib/quantizer/pqueue.d.ts":"44","/node_vibrant/lib/quantizer/pqueue.js":"45","/node_vibrant/lib/quantizer/vbox.d.ts":"46","/node_vibrant/lib/quantizer/vbox.js":"47","/node_vibrant/lib/typing.d.ts":"48","/node_vibrant/lib/typing.js":"49","/node_vibrant/lib/util.d.ts":"50","/node_vibrant/lib/util.js":"51","/node_vibrant/lib/vibrant.d.ts":"52","/node_vibrant/lib/vibrant.js":"53"},{"size":238,"mtime":1588446397444,"results":"54","hashOfConfig":"55"},{"size":1667,"mtime":1588572862980,"results":"56","hashOfConfig":"57"},{"size":1942,"mtime":1588506946248,"results":"58","hashOfConfig":"57"},{"size":161,"mtime":1588503588651,"results":"59","hashOfConfig":"57"},{"size":465,"mtime":1588506456241,"results":"60","hashOfConfig":"57"},{"size":8317,"mtime":1588518071602,"results":"61","hashOfConfig":"57"},{"size":109,"mtime":1588518456074,"results":"62","hashOfConfig":"57"},{"size":1037,"mtime":1588572479152,"results":"63","hashOfConfig":"57"},{"size":1612,"mtime":1588572431461,"results":"64","hashOfConfig":"57"},{"size":144,"mtime":1774828901639,"results":"65","hashOfConfig":"57"},{"size":49,"mtime":1588518729083,"results":"66","hashOfConfig":"57"},{"size":1643,"mtime":1588518668836,"results":"67","hashOfConfig":"57"},{"size":915,"mtime":1588508311698,"results":"68","hashOfConfig":"57"},{"size":6820,"mtime":1588517843664,"results":"69","hashOfConfig":"57"},{"size":886,"mtime":1588503314318,"results":"70","hashOfConfig":"71"},{"size":648,"mtime":1588573661836,"results":"72","hashOfConfig":"71"},{"size":3651,"mtime":1588575855498,"results":"73","hashOfConfig":"71"},{"size":707,"mtime":1588573158957,"results":"74","hashOfConfig":"71"},{"size":1659,"mtime":1774829769663,"results":"75","hashOfConfig":"57"},{"size":5530,"mtime":1588514247928,"results":"76","hashOfConfig":"57"},{"size":2326,"mtime":1588575936321,"results":"77","hashOfConfig":"57"},{"size":792,"mtime":1588516999353,"results":"78","hashOfConfig":"55"},{"size":2867,"mtime":1588516999353,"results":"79","hashOfConfig":"55"},{"size":778,"mtime":1588516999217,"results":"80","hashOfConfig":"55"},{"size":3366,"mtime":1588516999213,"results":"81","hashOfConfig":"55"},{"size":92,"mtime":1588516999325,"results":"82","hashOfConfig":"55"},{"size":241,"mtime":1588516999321,"results":"83","hashOfConfig":"55"},{"size":163,"mtime":1588516999325,"results":"84","hashOfConfig":"55"},{"size":601,"mtime":1588516999325,"results":"85","hashOfConfig":"55"},{"size":592,"mtime":1588516999317,"results":"86","hashOfConfig":"55"},{"size":7439,"mtime":1588516999313,"results":"87","hashOfConfig":"55"},{"size":48,"mtime":1588516999321,"results":"88","hashOfConfig":"55"},{"size":185,"mtime":1588516999321,"results":"89","hashOfConfig":"55"},{"size":420,"mtime":1588516999361,"results":"90","hashOfConfig":"55"},{"size":881,"mtime":1588516999357,"results":"91","hashOfConfig":"55"},{"size":330,"mtime":1588516999373,"results":"92","hashOfConfig":"55"},{"size":2968,"mtime":1588516999373,"results":"93","hashOfConfig":"55"},{"size":51,"mtime":1588516999377,"results":"94","hashOfConfig":"55"},{"size":398,"mtime":1588516999377,"results":"95","hashOfConfig":"55"},{"size":42,"mtime":1588516999293,"results":"96","hashOfConfig":"55"},{"size":173,"mtime":1588516999289,"results":"97","hashOfConfig":"55"},{"size":187,"mtime":1588516999289,"results":"98","hashOfConfig":"55"},{"size":1909,"mtime":1588516999289,"results":"99","hashOfConfig":"55"},{"size":353,"mtime":1588516999281,"results":"100","hashOfConfig":"55"},{"size":1731,"mtime":1588516999281,"results":"101","hashOfConfig":"55"},{"size":682,"mtime":1588516999273,"results":"102","hashOfConfig":"55"},{"size":8712,"mtime":1588516999273,"results":"103","hashOfConfig":"55"},{"size":1443,"mtime":1588516999229,"results":"104","hashOfConfig":"55"},{"size":111,"mtime":1588516999221,"results":"105","hashOfConfig":"55"},{"size":1384,"mtime":1588516999197,"results":"106","hashOfConfig":"55"},{"size":5719,"mtime":1588516999185,"results":"107","hashOfConfig":"55"},{"size":891,"mtime":1588516999345,"results":"108","hashOfConfig":"55"},{"size":3231,"mtime":1588516999341,"results":"109","hashOfConfig":"55"},{"filePath":"110","messages":"111","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"11utqc",{"filePath":"112","messages":"113","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"114"},"1ffsapi",{"filePath":"115","messages":"116","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"117"},{"filePath":"118","messages":"119","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"120"},{"filePath":"121","messages":"122","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"123"},{"filePath":"124","messages":"125","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"126"},{"filePath":"127","messages":"128","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"129"},{"filePath":"130","messages":"131","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"132"},{"filePath":"133","messages":"134","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"135"},{"filePath":"136","messages":"137","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"138"},{"filePath":"139","messages":"140","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"141"},{"filePath":"142","messages":"143","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"144"},{"filePath":"145","messages":"146","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"147"},{"filePath":"148","messages":"149","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"150"},{"filePath":"151","messages":"152","suppressedMessages":"153","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"t5v1h3",{"filePath":"154","messages":"155","suppressedMessages":"156","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"157","messages":"158","suppressedMessages":"159","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"160","messages":"161","suppressedMessages":"162","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"163","messages":"164","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"165"},{"filePath":"166","messages":"167","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"168"},{"filePath":"169","messages":"170","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"171"},{"filePath":"172","messages":"173","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"174","messages":"175","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"176","messages":"177","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"178","messages":"179","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"180","messages":"181","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"182","messages":"183","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"184","messages":"185","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"186","messages":"187","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"188","messages":"189","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"190","messages":"191","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"192","messages":"193","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"194","messages":"195","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"196","messages":"197","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"198","messages":"199","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"200","messages":"201","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"202","messages":"203","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"204","messages":"205","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"206","messages":"207","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"208","messages":"209","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"210","messages":"211","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"212","messages":"213","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"214","messages":"215","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"216","messages":"217","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"218","messages":"219","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"220","messages":"221","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"222","messages":"223","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"224","messages":"225","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"226","messages":"227","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"228","messages":"229","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"230","messages":"231","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"232","messages":"233","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"234","messages":"235","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/node_vibrant/fixtures/sample/types.ts",["236"],"/node_vibrant/src/builder.ts",["237"],"import type {\n Callback,\n ImageClass,\n ImageSource,\n Options,\n Filter,\n Quantizer,\n Generator,\n PaletteResult,\n} from './typing';\n\n// eslint-disable-next-line import/no-cycle\nimport Vibrant from './vibrant';\n\nexport default class Builder {\n #src: ImageSource;\n\n #opts: Partial<Options>;\n\n constructor(src: ImageSource, opts: Partial<Options> = {}) {\n this.#src = src;\n this.#opts = opts;\n\n if (Vibrant.DefaultOpts.filters) {\n this.#opts.filters = [...Vibrant.DefaultOpts.filters];\n } else {\n this.#opts.filters = [];\n }\n }\n\n maxColorCount(n: number): Builder {\n this.#opts.colorCount = n;\n return this;\n }\n\n maxDimension(d: number): Builder {\n this.#opts.maxDimension = d;\n return this;\n }\n\n addFilter(f: Filter): Builder {\n this.#opts.filters!.push(f);\n return this;\n }\n\n removeFilter(f: Filter): Builder {\n const i = this.#opts.filters!.indexOf(f);\n if (i > 0) this.#opts.filters!.splice(i);\n return this;\n }\n\n clearFilters(): Builder {\n this.#opts.filters = [];\n return this;\n }\n\n quality(q: number): Builder {\n this.#opts.quality = q;\n return this;\n }\n\n useImageClass(imageClass: ImageClass): Builder {\n this.#opts.ImageClass = imageClass;\n return this;\n }\n\n useGenerator(generator: Generator<any>): Builder {\n this.#opts.generator = generator;\n return this;\n }\n\n useQuantizer(quantizer: Quantizer): Builder {\n this.#opts.quantizer = quantizer;\n return this;\n }\n\n build(): Vibrant {\n return new Vibrant(this.#src, this.#opts);\n }\n\n getPalette(cb?: Callback<PaletteResult>): Promise<PaletteResult> {\n return this.build().getPalette(cb);\n }\n}\n","/node_vibrant/src/color.ts",["238"],"import type { Filter } from './typing';\nimport { rgbToHsl, rgbToHex } from './util';\n\nexport type Vec3 = [number, number, number];\n\nexport interface Palette {\n Vibrant?: Swatch,\n Muted?: Swatch,\n DarkVibrant?: Swatch,\n DarkMuted?: Swatch,\n LightVibrant?: Swatch,\n LightMuted?: Swatch\n [name: string]: Swatch | undefined\n}\n\nexport class Swatch {\n static applyFilter(colors: Swatch[], f: Filter): Swatch[] {\n if (typeof f !== 'function') {\n return colors;\n }\n\n return [].filter.call(\n colors,\n ({ r, g, b }: { r: number, g: number, b: number }) => f(r, g, b, 255),\n );\n }\n\n #rgb: Vec3;\n\n #population: number;\n\n #hsl?: Vec3;\n\n #yiq?: number;\n\n #hex?: string;\n\n #titleTextColor?: string;\n\n #bodyTextColor?: string;\n\n constructor(rgb: Vec3, population: number) {\n this.#rgb = rgb;\n this.#population = population;\n }\n\n get r() { return this.#rgb[0]; }\n\n get g() { return this.#rgb[1]; }\n\n get b() { return this.#rgb[2]; }\n\n get rgb() { return this.#rgb; }\n\n get hsl() {\n if (!this.#hsl) {\n this.#hsl = rgbToHsl(...this.#rgb);\n }\n\n return this.#hsl;\n }\n\n get hex() {\n if (!this.#hex) {\n const [r, g, b] = this.#rgb;\n this.#hex = rgbToHex(r, g, b);\n }\n return this.#hex;\n }\n\n get population() { return this.#population; }\n\n toJSON() {\n return {\n rgb: this.rgb,\n population: this.population,\n };\n }\n\n private getYiq(): number {\n if (!this.#yiq) {\n const rgb = this.#rgb;\n this.#yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n }\n\n return this.#yiq;\n }\n\n get titleTextColor(): string {\n if (!this.#titleTextColor) {\n this.#titleTextColor = this.getYiq() < 200 ? '#fff' : '#000';\n }\n\n return this.#titleTextColor;\n }\n\n get bodyTextColor(): string {\n if (!this.#bodyTextColor) {\n this.#bodyTextColor = this.getYiq() < 150 ? '#fff' : '#000';\n }\n\n return this.#bodyTextColor;\n }\n}\n","/node_vibrant/src/filter/default.ts",["239"],"export default function defaultFilter(\n r: number,\n g: number,\n b: number,\n a: number,\n): boolean {\n return a >= 125 && !(r > 250 && g > 250 && b > 250);\n}\n","/node_vibrant/src/filter/index.ts",["240"],"import type { Filter } from '../typing';\n\nexport { default as Default } from './default';\n\nexport function combineFilters(filters: Filter[]): Filter | null {\n // TODO: caching\n if (!Array.isArray(filters) || filters.length === 0) return null;\n\n return (r: number, g: number, b: number, a: number) => {\n if (a === 0) return false;\n for (let i = 0; i < filters.length; i += 1) {\n if (!filters[i](r, g, b, a)) return false;\n }\n return true;\n };\n}\n","/node_vibrant/src/generator/default.ts",["241"],"/* eslint-disable no-param-reassign */\nimport { Swatch, Palette, Vec3 } from '../color';\nimport { Generator } from '../typing';\nimport { hslToRgb } from '../util';\n\ninterface DefaultGeneratorOptions {\n targetDarkLuma: number,\n maxDarkLuma: number,\n minLightLuma: number,\n targetLightLuma: number,\n minNormalLuma: number,\n targetNormalLuma: number,\n maxNormalLuma: number,\n targetMutesSaturation: number,\n maxMutesSaturation: number,\n targetVibrantSaturation: number,\n minVibrantSaturation: number,\n weightSaturation: number,\n weightLuma: number,\n weightPopulation: number\n}\n\nconst DefaultOpts: DefaultGeneratorOptions = {\n targetDarkLuma: 0.26,\n maxDarkLuma: 0.45,\n minLightLuma: 0.55,\n targetLightLuma: 0.74,\n minNormalLuma: 0.3,\n targetNormalLuma: 0.5,\n maxNormalLuma: 0.7,\n targetMutesSaturation: 0.3,\n maxMutesSaturation: 0.4,\n targetVibrantSaturation: 1.0,\n minVibrantSaturation: 0.35,\n weightSaturation: 3,\n weightLuma: 6.5,\n weightPopulation: 0.5,\n};\n\nfunction findMaxPopulation(swatches: Array<Swatch>): number {\n let p = 0;\n\n swatches.forEach((s) => { p = Math.max(p, s.population); });\n\n return p;\n}\n\nfunction isAlreadySelected(palette: Palette, s: Swatch): boolean {\n return palette.Vibrant === s\n || palette.DarkVibrant === s\n || palette.LightVibrant === s\n || palette.Muted === s\n || palette.DarkMuted === s\n || palette.LightMuted === s;\n}\n\nfunction createComparisonValue(\n saturation: number,\n targetSaturation: number,\n luma: number,\n targetLuma: number,\n population: number,\n maxPopulation: number,\n opts: DefaultGeneratorOptions,\n): number {\n function weightedMean(...values: number[]) {\n let sum = 0;\n let weightSum = 0;\n for (let i = 0; i < values.length; i += 2) {\n const value = values[i];\n const weight = values[i + 1];\n sum += value * weight;\n weightSum += weight;\n }\n\n return sum / weightSum;\n }\n\n function invertDiff(value: number, targetValue: number): number {\n return 1 - Math.abs(value - targetValue);\n }\n\n return weightedMean(\n invertDiff(saturation, targetSaturation), opts.weightSaturation,\n invertDiff(luma, targetLuma), opts.weightLuma,\n population / maxPopulation, opts.weightPopulation,\n );\n}\n\nfunction findColorVariation(\n palette: Palette,\n swatches: Array<Swatch>,\n maxPopulation: number,\n targetLuma: number,\n minLuma: number,\n maxLuma: number,\n targetSaturation: number,\n minSaturation: number,\n maxSaturation: number,\n opts: DefaultGeneratorOptions,\n): Swatch {\n let max: Swatch | null = null;\n let maxValue = 0;\n\n swatches.forEach((swatch) => {\n const [, s, l] = swatch.hsl;\n\n if (s >= minSaturation && s <= maxSaturation\n && l >= minLuma && l <= maxLuma\n && !isAlreadySelected(palette, swatch)\n ) {\n const value = createComparisonValue(\n s,\n targetSaturation,\n l,\n targetLuma,\n swatch.population,\n maxPopulation,\n opts,\n );\n\n if (max === null || value > maxValue) {\n max = swatch;\n maxValue = value;\n }\n }\n });\n\n return max!;\n}\n\nfunction generateVariationColors(\n swatches: Array<Swatch>,\n maxPopulation: number,\n opts: DefaultGeneratorOptions,\n): Palette {\n const palette: Palette = {};\n\n // mVibrantSwatch = findColor(TARGET_NORMAL_LUMA, MIN_NORMAL_LUMA, MAX_NORMAL_LUMA,\n // TARGET_VIBRANT_SATURATION, MIN_VIBRANT_SATURATION, 1f);\n palette.Vibrant = findColorVariation(\n palette,\n swatches,\n maxPopulation,\n opts.targetNormalLuma,\n opts.minNormalLuma,\n opts.maxNormalLuma,\n opts.targetVibrantSaturation,\n opts.minVibrantSaturation,\n 1,\n opts,\n );\n\n // mLightVibrantSwatch = findColor(TARGET_LIGHT_LUMA, MIN_LIGHT_LUMA, 1f,\n // TARGET_VIBRANT_SATURATION, MIN_VIBRANT_SATURATION, 1f);\n palette.LightVibrant = findColorVariation(\n palette,\n swatches,\n maxPopulation,\n opts.targetLightLuma,\n opts.minLightLuma,\n 1,\n opts.targetVibrantSaturation,\n opts.minVibrantSaturation,\n 1,\n opts,\n );\n\n // mDarkVibrantSwatch = findColor(TARGET_DARK_LUMA, 0f, MAX_DARK_LUMA,\n // TARGET_VIBRANT_SATURATION, MIN_VIBRANT_SATURATION, 1f);\n palette.DarkVibrant = findColorVariation(\n palette,\n swatches,\n maxPopulation,\n opts.targetDarkLuma,\n 0,\n opts.maxDarkLuma,\n opts.targetVibrantSaturation,\n opts.minVibrantSaturation,\n 1,\n opts,\n );\n\n // mMutedSwatch = findColor(TARGET_NORMAL_LUMA, MIN_NORMAL_LUMA, MAX_NORMAL_LUMA,\n // TARGET_MUTED_SATURATION, 0f, MAX_MUTED_SATURATION);\n palette.Muted = findColorVariation(\n palette,\n swatches,\n maxPopulation,\n opts.targetNormalLuma,\n opts.minNormalLuma,\n opts.maxNormalLuma,\n opts.targetMutesSaturation,\n 0,\n opts.maxMutesSaturation,\n opts,\n );\n\n // mLightMutedColor = findColor(TARGET_LIGHT_LUMA, MIN_LIGHT_LUMA, 1f,\n // TARGET_MUTED_SATURATION, 0f, MAX_MUTED_SATURATION);\n palette.LightMuted = findColorVariation(\n palette,\n swatches,\n maxPopulation,\n opts.targetLightLuma,\n opts.minLightLuma,\n 1,\n opts.targetMutesSaturation,\n 0,\n opts.maxMutesSaturation,\n opts,\n );\n\n // mDarkMutedSwatch = findColor(TARGET_DARK_LUMA, 0f, MAX_DARK_LUMA,\n // TARGET_MUTED_SATURATION, 0f, MAX_MUTED_SATURATION);\n palette.DarkMuted = findColorVariation(\n palette,\n swatches,\n maxPopulation,\n opts.targetDarkLuma,\n 0,\n opts.maxDarkLuma,\n opts.targetMutesSaturation,\n 0,\n opts.maxMutesSaturation,\n opts,\n );\n\n return palette;\n}\n\nfunction withLuminance(hsl: Vec3, l: number): Vec3 {\n const [h, s] = hsl;\n\n return [h, s, l];\n}\n\nfunction generateEmptySwatches(\n palette: Palette,\n maxPopulation: number,\n opts: DefaultGeneratorOptions,\n): void {\n if (palette.Vibrant === null && palette.DarkVibrant === null && palette.LightVibrant === null) {\n if (palette.DarkVibrant === null && palette.DarkMuted !== null) {\n const [h, s, l] = withLuminance(palette.DarkMuted!.hsl, opts.targetDarkLuma);\n palette.DarkVibrant = new Swatch(hslToRgb(h, s, l), 0);\n }\n\n if (palette.LightVibrant === null && palette.LightMuted !== null) {\n const [h, s, l] = withLuminance(palette.LightMuted!.hsl, opts.targetDarkLuma);\n palette.DarkVibrant = new Swatch(hslToRgb(h, s, l), 0);\n }\n }\n\n if (palette.Vibrant === null && palette.DarkVibrant !== null) {\n const [h, s, l] = withLuminance(palette.DarkVibrant!.hsl, opts.targetNormalLuma);\n palette.Vibrant = new Swatch(hslToRgb(h, s, l), 0);\n } else if (palette.Vibrant === null && palette.LightVibrant !== null) {\n const [h, s, l] = withLuminance(palette.LightVibrant!.hsl, opts.targetNormalLuma);\n palette.Vibrant = new Swatch(hslToRgb(h, s, l), 0);\n }\n\n if (palette.DarkVibrant === null && palette.Vibrant !== null) {\n const [h, s, l] = withLuminance(palette.Vibrant!.hsl, opts.targetDarkLuma);\n palette.DarkVibrant = new Swatch(hslToRgb(h, s, l), 0);\n }\n\n if (palette.LightVibrant === null && palette.Vibrant !== null) {\n const [h, s, l] = withLuminance(palette.Vibrant!.hsl, opts.targetLightLuma);\n palette.LightVibrant = new Swatch(hslToRgb(h, s, l), 0);\n }\n\n if (palette.Muted === null && palette.Vibrant !== null) {\n const [h, s, l] = withLuminance(palette.Vibrant!.hsl, opts.targetMutesSaturation);\n palette.Muted = new Swatch(hslToRgb(h, s, l), 0);\n }\n\n if (palette.DarkMuted === null && palette.DarkVibrant !== null) {\n const [h, s, l] = withLuminance(palette.DarkVibrant!.hsl, opts.targetMutesSaturation);\n palette.DarkMuted = new Swatch(hslToRgb(h, s, l), 0);\n }\n\n if (palette.LightMuted === null && palette.LightVibrant !== null) {\n const [h, s, l] = withLuminance(palette.LightVibrant!.hsl, opts.targetMutesSaturation);\n palette.LightMuted = new Swatch(hslToRgb(h, s, l), 0);\n }\n}\n\nconst DefaultGenerator: Generator<DefaultGeneratorOptions> = (\n swatches: Array<Swatch>,\n opts?: DefaultGeneratorOptions,\n): Palette => {\n const optsWithDefaults = { ...DefaultOpts, ...opts };\n const maxPopulation = findMaxPopulation(swatches);\n\n const palette = generateVariationColors(swatches, maxPopulation, optsWithDefaults);\n generateEmptySwatches(palette, maxPopulation, optsWithDefaults);\n\n return palette;\n};\n\nexport default DefaultGenerator;\nexport { DefaultGeneratorOptions };\n","/node_vibrant/src/generator/index.ts",["242"],"import Default from './default';\nimport type { Generator } from '../typing';\n\nexport { Generator, Default };\n","/node_vibrant/src/image/base.ts",["243"],"import type {\n Filter, Image, ImageData, ImageSource, ComputedOptions,\n} from '../typing';\n\nabstract class ImageBase implements Image {\n abstract load(image: ImageSource, opts: ComputedOptions): Promise<ImageBase>;\n\n abstract readonly pixelCount: number;\n\n abstract readonly imageData: ImageData;\n\n abstract readonly width: number;\n\n abstract readonly height: number;\n\n abstract cleanup(): void;\n\n applyFilter(filter: Filter): Promise<ImageData> {\n const { imageData } = this;\n\n if (typeof filter === 'function') {\n const pixels = imageData.data;\n const n = pixels.length / 4;\n let offset;\n let r;\n let g;\n let b;\n let a;\n\n for (let i = 0; i < n; i += 1) {\n offset = i * 4;\n r = pixels[offset + 0];\n g = pixels[offset + 1];\n b = pixels[offset + 2];\n a = pixels[offset + 3];\n // Mark ignored color\n if (!filter(r, g, b, a)) pixels[offset + 3] = 0;\n }\n }\n\n return Promise.resolve(imageData);\n }\n}\n\nexport default ImageBase;\n","/node_vibrant/src/image/sharp.ts",["244"],"import sharp from 'sharp';\nimport type { Sharp } from 'sharp';\nimport type { ImageData, ImageSource, ComputedOptions } from '../typing';\nimport ImageBase from './base';\n\nexport default class SharpImage extends ImageBase {\n #imageData?: ImageData;\n\n async load(image: ImageSource, opts: ComputedOptions): Promise<ImageBase> {\n let sharpInstance: Sharp;\n\n // Check to see if image is a sharp instance.\n // Because sharp doesn't return a class, there's not much else we can do to verify type.\n if (typeof image === 'object' && 'resize' in image) {\n sharpInstance = <Sharp><unknown>image;\n } else if (typeof image === 'string' || image instanceof Buffer) {\n sharpInstance = sharp(image);\n } else {\n return Promise.reject(new Error(`Cannot load image of type ${typeof image}`));\n }\n\n if (opts.maxDimension > 0) {\n sharpInstance = sharpInstance.resize(opts.maxDimension, opts.maxDimension, {\n fit: 'inside',\n withoutEnlargement: true,\n });\n }\n\n const buffer = await sharpInstance.ensureAlpha().raw().toBuffer({ resolveWithObject: true });\n\n this.#imageData = {\n data: buffer.data,\n width: buffer.info.width,\n height: buffer.info.height,\n };\n\n return this;\n }\n\n get pixelCount(): number {\n return this.imageData.width * this.imageData.height;\n }\n\n get imageData(): ImageData {\n return this.#imageData!;\n }\n\n get width(): number {\n return this.imageData.width;\n }\n\n get height(): number {\n return this.imageData.height;\n }\n\n // eslint-disable-next-line class-methods-use-this\n cleanup(): void {\n\n }\n}\n","/node_vibrant/src/index.ts",["245"],"import Vibrant from './vibrant';\nimport SharpImage from './image/sharp';\n\nVibrant.DefaultOpts.ImageClass = SharpImage;\n\nexport default Vibrant;\n","/node_vibrant/src/quantizer/index.ts",["246"],"import MMCQ from './mmcq';\n\nexport default MMCQ;\n","/node_vibrant/src/quantizer/mmcq.ts",["247"],"import type {\n Pixels,\n ComputedOptions,\n Quantizer,\n} from '../typing';\nimport { Swatch } from '../color';\nimport VBox from './vbox';\nimport PQueue from './pqueue';\n\nconst fractByPopulations = 0.75;\n\nfunction splitBoxes(pq: PQueue<VBox>, target: number): void {\n let lastSize = pq.size;\n\n while (pq.size < target) {\n const vbox = pq.pop();\n\n if (!vbox || vbox.count < 1) {\n break;\n }\n\n const [vbox1, vbox2] = vbox.split();\n\n pq.push(vbox1);\n if (vbox2 && vbox2.count > 0) pq.push(vbox2);\n\n // No more new boxes, converged\n if (pq.size === lastSize) {\n break;\n } else {\n lastSize = pq.size;\n }\n }\n}\n\nfunction generateSwatches(pq: PQueue<VBox>) {\n const swatches: Swatch[] = [];\n\n while (pq.size) {\n const v = pq.pop();\n const color = v.avg;\n swatches.push(new Swatch(color, v.count));\n }\n\n return swatches;\n}\n\nconst MMCQ: Quantizer = (pixels: Pixels, opts: ComputedOptions): Array<Swatch> => {\n if (pixels.length === 0 || opts.colorCount < 2 || opts.colorCount > 256) {\n throw new Error('Wrong MMCQ parameters');\n }\n\n const vbox = VBox.build(pixels);\n const pq = new PQueue<VBox>((a, b) => a.count - b.count);\n\n pq.push(vbox);\n\n // first set of colors, sorted by population\n splitBoxes(pq, fractByPopulations * opts.colorCount);\n\n // Re-order\n const pq2 = new PQueue<VBox>((a, b) => a.count * a.volume - b.count * b.volume);\n pq2.contents = pq.contents;\n\n // next set - generate the median cuts using the (npix * vol) sorting.\n splitBoxes(pq2, opts.colorCount - pq2.size);\n\n // calculate the actual colors\n return generateSwatches(pq2);\n};\n\nexport default MMCQ;\n","/node_vibrant/src/quantizer/pqueue.ts",["248"],"export interface PQueueComparator<T> {\n (a: T, b: T): number\n}\n\nexport default class PQueue<T> {\n contents: T[];\n\n #sorted: boolean;\n\n #comparator: PQueueComparator<T>;\n\n private sort(): void {\n if (!this.#sorted) {\n this.contents.sort(this.#comparator);\n this.#sorted = true;\n }\n }\n\n constructor(comparator: PQueueComparator<T>) {\n this.#comparator = comparator;\n this.contents = [];\n this.#sorted = false;\n }\n\n push(item: T): void {\n this.contents.push(item);\n this.#sorted = false;\n }\n\n peek(index?: number): T {\n this.sort();\n return this.contents[typeof index === 'number' ? index : this.contents.length - 1];\n }\n\n pop(): T {\n this.sort();\n return this.contents.pop()!;\n }\n\n get size(): number {\n return this.contents.length;\n }\n\n map<U>(mapper: (item: T, index: number) => any): U[] {\n this.sort();\n return this.contents.map(mapper);\n }\n}\n","/node_vibrant/src/quantizer/vbox.ts",["249"],"import type { Vec3 } from '../color';\nimport type { Pixels } from '../typing';\nimport { getColorIndex, SIGBITS, RSHIFT } from '../util';\n\nexport interface Dimension {\n r1: number\n r2: number\n g1: number\n g2: number\n b1: number\n b2: number\n [d: string]: number\n}\n\nexport default class VBox {\n static build(pixels: Pixels): VBox {\n const hn = 1 << (3 * SIGBITS);\n const hist = new Uint32Array(hn);\n let rmax: number = 0;\n let rmin: number = Number.MAX_VALUE;\n let gmax: number = 0;\n let gmin: number = Number.MAX_VALUE;\n let bmax: number = 0;\n let bmin: number = Number.MAX_VALUE;\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n const n = pixels.length / 4;\n let i = 0;\n\n while (i < n) {\n const offset = i * 4;\n i += 1;\n r = pixels[offset + 0];\n g = pixels[offset + 1];\n b = pixels[offset + 2];\n a = pixels[offset + 3];\n\n // Ignored pixels' alpha is marked as 0 in filtering stage\n if (a === 0) continue;\n\n r >>= RSHIFT;\n g >>= RSHIFT;\n b >>= RSHIFT;\n\n const index = getColorIndex(r, g, b);\n hist[index] += 1;\n\n if (r > rmax) rmax = r;\n if (r < rmin) rmin = r;\n if (g > gmax) gmax = g;\n if (g < gmin) gmin = g;\n if (b > bmax) bmax = b;\n if (b < bmin) bmin = b;\n }\n\n return new VBox(rmin, rmax, gmin, gmax, bmin, bmax, hist);\n }\n\n dimension: Dimension;\n\n hist: Uint32Array;\n\n #volume = -1;\n\n #avg: Vec3 | null = null;\n\n #count = -1;\n\n constructor(\n r1: number, r2: number,\n g1: number, g2: number,\n b1: number, b2: number,\n hist: Uint32Array,\n ) {\n this.dimension = {\n r1, r2, g1, g2, b1, b2,\n };\n\n this.hist = hist;\n }\n\n invalidate(): void {\n this.#volume = -1;\n this.#count = -1;\n this.#avg = null;\n }\n\n get volume(): number {\n if (this.#volume < 0) {\n const {\n r1, r2, g1, g2, b1, b2,\n } = this.dimension;\n\n this.#volume = (r2 - r1 + 1) * (g2 - g1 + 1) * (b2 - b1 + 1);\n }\n\n return this.#volume;\n }\n\n get count(): number {\n if (this.#count < 0) {\n const { hist } = this;\n const {\n r1, r2, g1, g2, b1, b2,\n } = this.dimension;\n let c = 0;\n\n for (let r = r1; r <= r2; r += 1) {\n for (let g = g1; g <= g2; g += 1) {\n for (let b = b1; b <= b2; b += 1) {\n const index = getColorIndex(r, g, b);\n c += hist[index];\n }\n }\n }\n\n this.#count = c;\n }\n\n return this.#count;\n }\n\n clone(): VBox {\n const { hist } = this;\n const {\n r1, r2, g1, g2, b1, b2,\n } = this.dimension;\n return new VBox(r1, r2, g1, g2, b1, b2, hist);\n }\n\n get avg(): Vec3 {\n if (!this.#avg) {\n const { hist } = this;\n const {\n r1, r2, g1, g2, b1, b2,\n } = this.dimension;\n let ntot = 0;\n const mult = 1 << (8 - SIGBITS);\n let rsum: number = 0;\n let gsum: number = 0;\n let bsum: number = 0;\n\n for (let r = r1; r <= r2; r += 1) {\n for (let g = g1; g <= g2; g += 1) {\n for (let b = b1; b <= b2; b += 1) {\n const index = getColorIndex(r, g, b);\n const h = hist[index];\n ntot += h;\n rsum += (h * (r + 0.5) * mult);\n gsum += (h * (g + 0.5) * mult);\n bsum += (h * (b + 0.5) * mult);\n }\n }\n }\n\n if (ntot) {\n this.#avg = [\n ~~(rsum / ntot),\n ~~(gsum / ntot),\n ~~(bsum / ntot),\n ];\n } else {\n this.#avg = [\n ~~((mult * (r1 + r2 + 1)) / 2),\n ~~((mult * (g1 + g2 + 1)) / 2),\n ~~((mult * (b1 + b2 + 1)) / 2),\n ];\n }\n }\n\n return this.#avg;\n }\n\n contains(rgb: Vec3): boolean {\n let [r, g, b] = rgb;\n const {\n r1, r2, g1, g2, b1, b2,\n } = this.dimension;\n r >>= RSHIFT;\n g >>= RSHIFT;\n b >>= RSHIFT;\n\n return r >= r1 && r <= r2\n && g >= g1 && g <= g2\n && b >= b1 && b <= b2;\n }\n\n split(): VBox[] {\n const { hist } = this;\n const {\n r1, r2, g1, g2, b1, b2,\n } = this.dimension;\n const { count } = this;\n\n if (!count) return [];\n if (count === 1) return [this.clone()];\n\n const rw = r2 - r1 + 1;\n const gw = g2 - g1 + 1;\n const bw = b2 - b1 + 1;\n\n const maxw = Math.max(rw, gw, bw);\n let accSum: Uint32Array | null = null;\n let sum: number = 0;\n let total: number = 0;\n\n let maxd: 'r' | 'g' | 'b' | null = null;\n\n if (maxw === rw) {\n maxd = 'r';\n accSum = new Uint32Array(r2 + 1);\n for (let r = r1; r <= r2; r += 1) {\n sum = 0;\n for (let g = g1; g <= g2; g += 1) {\n for (let b = b1; b <= b2; b += 1) {\n const index = getColorIndex(r, g, b);\n sum += hist[index];\n }\n }\n total += sum;\n accSum[r] = total;\n }\n } else if (maxw === gw) {\n maxd = 'g';\n accSum = new Uint32Array(g2 + 1);\n for (let g = g1; g <= g2; g += 1) {\n sum = 0;\n for (let r = r1; r <= r2; r += 1) {\n for (let b = b1; b <= b2; b += 1) {\n const index = getColorIndex(r, g, b);\n sum += hist[index];\n }\n }\n total += sum;\n accSum[g] = total;\n }\n } else {\n maxd = 'b';\n accSum = new Uint32Array(b2 + 1);\n for (let b = b1; b <= b2; b += 1) {\n sum = 0;\n for (let r = r1; r <= r2; r += 1) {\n for (let g = g1; g <= g2; g += 1) {\n const index = getColorIndex(r, g, b);\n sum += hist[index];\n }\n }\n total += sum;\n accSum[b] = total;\n }\n }\n\n let splitPoint = -1;\n const reverseSum = new Uint32Array(accSum.length);\n for (let i = 0; i < accSum.length; i += 1) {\n const d = accSum[i];\n if (splitPoint < 0 && d > total / 2) splitPoint = i;\n reverseSum[i] = total - d;\n }\n\n return this.doCut(maxd, splitPoint, accSum, reverseSum);\n }\n\n private doCut(\n d: string,\n splitPoint: number,\n accSum: Uint32Array,\n reverseSum: Uint32Array,\n ): VBox[] {\n const dim1 = `${d}1`;\n const dim2 = `${d}2`;\n const d1 = this.dimension[dim1];\n let d2 = this.dimension[dim2];\n const vbox1 = this.clone();\n const vbox2 = this.clone();\n const left = splitPoint - d1;\n const right = d2 - splitPoint;\n\n if (left <= right) {\n d2 = Math.min(d2 - 1, ~~(splitPoint + right / 2));\n d2 = Math.max(0, d2);\n } else {\n d2 = Math.max(d1, ~~(splitPoint - 1 - left / 2));\n d2 = Math.min(this.dimension[dim2], d2);\n }\n\n while (!accSum![d2]) d2 += 1;\n\n let c2 = reverseSum[d2];\n\n while (!c2 && accSum![d2 - 1]) c2 = reverseSum[d2 -= 1];\n\n vbox1.dimension[dim2] = d2;\n vbox2.dimension[dim1] = d2 + 1;\n\n return [vbox1, vbox2];\n }\n}\n","/node_vibrant/src/test/builder.spec.ts",["250"],[],"/node_vibrant/src/test/common/data.ts",["251"],[],"/node_vibrant/src/test/common/helper.ts",["252"],[],"/node_vibrant/src/test/vibrant.spec.ts",["253"],[],"/node_vibrant/src/typing.ts",["254"],"import type { Palette, Swatch } from './color';\nimport type Builder from './builder';\nimport { type Sharp } from 'sharp';\n\nexport interface VibrantStatic {\n from(src: ImageSource): Builder\n}\n\nexport interface Callback<T> {\n (err?: Error, result?: T): void\n}\n\nexport type ImageCallback = Callback<Image>;\n\nexport type ImageSource = string | Buffer | Sharp;\n\nexport interface ImageDimensions {\n readonly width: number\n readonly height: number\n}\n\nexport interface ImagePixelInfo {\n readonly pixelCount: number\n}\n\nexport type Pixels = Uint8ClampedArray | Buffer;\nexport interface ImageData extends ImageDimensions {\n data: Pixels\n}\n\nexport interface PaletteResult extends ImagePixelInfo {\n readonly imageDimensions: ImageDimensions\n readonly palette: Palette\n}\n\nexport interface Image extends ImageDimensions, ImagePixelInfo {\n readonly imageData: ImageData\n\n load(image: ImageSource, opts: ComputedOptions): Promise<Image>\n applyFilter(filter: Filter): Promise<ImageData>\n cleanup(): void\n}\n\nexport type Resolvable<T> = T | Promise<T>;\n\nexport interface ImageClass {\n new(): Image\n}\n\nexport interface Filter {\n (red: number, green: number, blue: number, alpha: number): boolean\n}\n\nexport interface Quantizer {\n (pixels: Pixels, opts: ComputedOptions): Resolvable<Array<Swatch>>\n}\n\nexport interface Generator<T> {\n (swatches: Array<Swatch>, opts?: T): Resolvable<Palette>\n}\n\nexport interface Options {\n colorCount: number\n quality: number\n maxDimension: number\n filters: Array<Filter>\n ImageClass: ImageClass\n quantizer: Quantizer\n generator?: Generator<any>\n}\n\nexport interface ComputedOptions extends Options {\n combinedFilter: Filter\n}\n","/node_vibrant/src/util.ts",["255"],"import type { Vec3 } from './color';\n\nexport const DELTAE94_DIFF_STATUS = {\n NA: 0,\n PERFECT: 1,\n CLOSE: 2,\n GOOD: 10,\n SIMILAR: 50,\n};\n\nexport const SIGBITS = 5;\nexport const RSHIFT = 8 - SIGBITS;\n\nexport interface IndexedObject {\n [key: string]: any\n}\n\nexport interface DeferredPromise<R> {\n resolve: (thenableOrResult: R | PromiseLike<R>) => void\n reject: (error: any) => void\n promise: Promise<R>\n}\n\nexport function defer<R>(): DeferredPromise<R> {\n let resolve: (thenableOrResult: R | PromiseLike<R>) => void;\n let reject: (error: any) => void;\n\n const promise = new Promise<R>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n\n // @ts-ignore\n return { resolve, reject, promise };\n}\n\nexport function hexToRgb(hex: string): Vec3 | null {\n const m = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\n return m === null ? null : <Vec3>[m[1], m[2], m[3]].map((s) => parseInt(s, 16));\n}\n\nexport function rgbToHex(r: number, g: number, b: number): string {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1, 7)}`;\n}\n\n// ir/ig/ib = (input)r/g/b - done for the purpose of linting.\nexport function rgbToHsl(ir: number, ig: number, ib: number): Vec3 {\n const r = ir / 255;\n const g = ig / 255;\n const b = ib / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h: number = 0;\n let s: number = 0;\n const l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n\n case g:\n h = (b - r) / d + 2;\n break;\n\n case b:\n h = (r - g) / d + 4;\n break;\n\n default:\n // do nothing\n }\n\n h /= 6;\n }\n\n return [h, s, l];\n}\n\n// it = (input)t\nfunction hue2rgb(p: number, q: number, it: number): number {\n let t = it;\n\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n\n return p;\n}\n\nexport function hslToRgb(h: number, s: number, l: number): Vec3 {\n let r: number = l;\n let g: number = l;\n let b: number = l;\n\n if (s !== 0) {\n // non-achromatic\n const q = l < 0.5 ? l * (1 + s) : l + s - (l * s);\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - (1 / 3));\n }\n\n return [\n r * 255 | 0,\n g * 255 | 0,\n b * 255 | 0,\n ];\n}\n\n// ir/ig/ib = (input)r/g/b - done for the purpose of linting.\nexport function rgbToXyz(ir: number, ig: number, ib: number): Vec3 {\n let r = ir / 255;\n let g = ig / 255;\n let b = ib / 255;\n\n r = r > 0.04045 ? (((r + 0.005) / 1.055) ** 2.4) : r / 12.92;\n g = g > 0.04045 ? (((g + 0.005) / 1.055) ** 2.4) : g / 12.92;\n b = b > 0.04045 ? (((b + 0.005) / 1.055) ** 2.4) : b / 12.92;\n\n r *= 100;\n g *= 100;\n b *= 100;\n\n const x = r * 0.4124 + g * 0.3576 + b * 0.1805;\n const y = r * 0.2126 + g * 0.7152 + b * 0.0722;\n const z = r * 0.0193 + g * 0.1192 + b * 0.9505;\n\n return [x, y, z];\n}\n\n// ix/iy/iz = (input)x/y/z\nexport function xyzToCIELab(ix: number, iy: number, iz: number): Vec3 {\n const REF_X = 95.047;\n const REF_Y = 100;\n const REF_Z = 108.883;\n\n let x = ix / REF_X;\n let y = iy / REF_Y;\n let z = iz / REF_Z;\n\n x = x > 0.008856 ? (x ** 1 / 3) : 7.787 * x + 16 / 116;\n y = y > 0.008856 ? (y ** 1 / 3) : 7.787 * y + 16 / 116;\n z = z > 0.008856 ? (z ** 1 / 3) : 7.787 * z + 16 / 116;\n\n const L = 116 * y - 16;\n const a = 500 * (x - y);\n const b = 200 * (y - z);\n\n return [L, a, b];\n}\n\nexport function rgbToCIELab(r: number, g: number, b: number): Vec3 {\n const [x, y, z] = rgbToXyz(r, g, b);\n return xyzToCIELab(x, y, z);\n}\n\nexport function deltaE94(lab1: Vec3, lab2: Vec3): number {\n const WEIGHT_L = 1;\n const WEIGHT_C = 1;\n const WEIGHT_H = 1;\n\n const [L1, a1, b1] = lab1;\n const [L2, a2, b2] = lab2;\n const dL = L1 - L2;\n const da = a1 - a2;\n const db = b1 - b2;\n\n const xC1 = Math.sqrt(a1 * a1 + b1 * b1);\n const xC2 = Math.sqrt(a2 * a2 + b2 * b2);\n\n let xDL = L2 - L1;\n let xDC = xC2 - xC1;\n const xDE = Math.sqrt(dL * dL + da * da + db * db);\n\n let xDH = (Math.sqrt(xDE) > Math.sqrt(Math.abs(xDL)) + Math.sqrt(Math.abs(xDC)))\n ? Math.sqrt(xDE * xDE - xDL * xDL - xDC * xDC)\n : 0;\n\n const xSC = 1 + 0.045 * xC1;\n const xSH = 1 + 0.015 * xC1;\n\n xDL /= WEIGHT_L;\n xDC /= WEIGHT_C * xSC;\n xDH /= WEIGHT_H * xSH;\n\n return Math.sqrt(xDL * xDL + xDC * xDC + xDH * xDH);\n}\n\nexport function rgbDiff(rgb1: Vec3, rgb2: Vec3): number {\n const lab1 = rgbToCIELab(...rgb1);\n const lab2 = rgbToCIELab(...rgb2);\n return deltaE94(lab1, lab2);\n}\n\nexport function hexDiff(hex1: string, hex2: string): number {\n const rgb1 = hexToRgb(hex1);\n const rgb2 = hexToRgb(hex2);\n\n return rgbDiff(rgb1!, rgb2!);\n}\n\nexport function getColorDiffStatus(d: number): string {\n if (d < DELTAE94_DIFF_STATUS.NA) { return 'N/A'; }\n\n // Not perceptible by human eyes\n if (d <= DELTAE94_DIFF_STATUS.PERFECT) { return 'Perfect'; }\n\n // Perceptible through close observation\n if (d <= DELTAE94_DIFF_STATUS.CLOSE) { return 'Close'; }\n\n // Perceptible at a glance\n if (d <= DELTAE94_DIFF_STATUS.GOOD) { return 'Good'; }\n\n // Colors are more similar than opposite\n if (d < DELTAE94_DIFF_STATUS.SIMILAR) { return 'Similar'; }\n\n return 'Wrong';\n}\n\nexport function getColorIndex(r: number, g: number, b: number): number {\n return (r << (2 * SIGBITS)) + (g << SIGBITS) + b;\n}\n","/node_vibrant/src/vibrant.ts",["256"],"import type {\n Image,\n ImageSource,\n Options,\n ComputedOptions,\n Callback,\n PaletteResult,\n} from './typing';\n\nimport { Palette, Swatch } from './color';\n\n// eslint-disable-next-line import/no-cycle\nimport Builder from './builder';\n\nimport * as Util from './util';\n\nimport QuantizerMMCQ from './quantizer';\nimport { Default as DefaultGenerator } from './generator';\n// eslint-disable-next-line import/no-cycle\nimport * as Filters from './filter';\n\nclass Vibrant {\n static Builder = Builder;\n\n static Quantizer = QuantizerMMCQ;\n\n static Generator = DefaultGenerator;\n\n static Filter = Filters;\n\n static Util = Util;\n\n static Swatch = Swatch;\n\n static DefaultOpts: Partial<Options> = {\n colorCount: 64,\n quality: 5,\n generator: DefaultGenerator,\n ImageClass: null!,\n quantizer: QuantizerMMCQ,\n filters: [Filters.Default],\n };\n\n static from(src: ImageSource): Builder {\n return new Builder(src);\n }\n\n opts: ComputedOptions;\n\n #src: ImageSource;\n\n constructor(src: ImageSource, opts?: Partial<Options>) {\n this.#src = src;\n this.opts = <ComputedOptions>({ ...Vibrant.DefaultOpts, ...opts });\n this.opts.combinedFilter = Filters.combineFilters(this.opts.filters)!;\n }\n\n private process(image: Image): Promise<Palette> {\n const { quantizer, generator } = this.opts;\n\n return image.applyFilter(this.opts.combinedFilter)\n .then((imageData) => quantizer(imageData.data, this.opts))\n .then((colors) => Swatch.applyFilter(colors, this.opts.combinedFilter))\n .then((colors) => Promise.resolve(generator!(colors)));\n }\n\n getPalette(cb?: Callback<PaletteResult>): Promise<PaletteResult> {\n const image = new this.opts.ImageClass();\n const result = image.load(this.#src, this.opts)\n .then((loadedImage) => this.process(loadedImage))\n .then((palette) => {\n const paletteResult: PaletteResult = {\n pixelCount: image.pixelCount,\n imageDimensions: {\n width: image.width,\n height: image.height,\n },\n palette,\n };\n image.cleanup();\n return paletteResult;\n }, (err) => {\n image.cleanup();\n throw err;\n });\n\n if (cb) {\n result.then((palette) => cb(null!, palette), (err) => cb(err));\n }\n\n return result;\n }\n}\n\nexport default Vibrant;\n","/node_vibrant/lib/builder.d.ts",["257"],"/node_vibrant/lib/builder.js",["258"],"/node_vibrant/lib/color.d.ts",["259"],"/node_vibrant/lib/color.js",["260"],"/node_vibrant/lib/filter/default.d.ts",["261"],"/node_vibrant/lib/filter/default.js",["262"],"/node_vibrant/lib/filter/index.d.ts",["263"],"/node_vibrant/lib/filter/index.js",["264"],"/node_vibrant/lib/generator/default.d.ts",["265"],"/node_vibrant/lib/generator/default.js",["266"],"/node_vibrant/lib/generator/index.d.ts",["267"],"/node_vibrant/lib/generator/index.js",["268"],"/node_vibrant/lib/image/base.d.ts",["269"],"/node_vibrant/lib/image/base.js",["270"],"/node_vibrant/lib/image/sharp.d.ts",["271"],"/node_vibrant/lib/image/sharp.js",["272"],"/node_vibrant/lib/index.d.ts",["273"],"/node_vibrant/lib/index.js",["274"],"/node_vibrant/lib/quantizer/index.d.ts",["275"],"/node_vibrant/lib/quantizer/index.js",["276"],"/node_vibrant/lib/quantizer/mmcq.d.ts",["277"],"/node_vibrant/lib/quantizer/mmcq.js",["278"],"/node_vibrant/lib/quantizer/pqueue.d.ts",["279"],"/node_vibrant/lib/quantizer/pqueue.js",["280"],"/node_vibrant/lib/quantizer/vbox.d.ts",["281"],"/node_vibrant/lib/quantizer/vbox.js",["282"],"/node_vibrant/lib/typing.d.ts",["283"],"/node_vibrant/lib/typing.js",["284"],"/node_vibrant/lib/util.d.ts",["285"],"/node_vibrant/lib/util.js",["286"],"/node_vibrant/lib/vibrant.d.ts",["287"],"/node_vibrant/lib/vibrant.js",["288"],{"ruleId":null,"fatal":true,"severity":2,"message":"289"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"291"},{"ruleId":null,"fatal":true,"severity":2,"message":"292"},{"ruleId":null,"fatal":true,"severity":2,"message":"293"},{"ruleId":null,"fatal":true,"severity":2,"message":"294"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"290"},{"ruleId":null,"fatal":true,"severity":2,"message":"295"},{"ruleId":null,"fatal":true,"severity":2,"message":"296"},{"ruleId":null,"fatal":true,"severity":2,"message":"297"},{"ruleId":null,"fatal":true,"severity":2,"message":"298"},{"ruleId":null,"fatal":true,"severity":2,"message":"299"},{"ruleId":null,"fatal":true,"severity":2,"message":"300"},{"ruleId":null,"fatal":true,"severity":2,"message":"301"},{"ruleId":null,"fatal":true,"severity":2,"message":"302"},{"ruleId":null,"fatal":true,"severity":2,"message":"303"},{"ruleId":null,"fatal":true,"severity":2,"message":"304"},{"ruleId":null,"fatal":true,"severity":2,"message":"305"},{"ruleId":null,"fatal":true,"severity":2,"message":"306"},{"ruleId":null,"fatal":true,"severity":2,"message":"307"},{"ruleId":null,"fatal":true,"severity":2,"message":"308"},{"ruleId":null,"fatal":true,"severity":2,"message":"309"},{"ruleId":null,"fatal":true,"severity":2,"message":"310"},{"ruleId":null,"fatal":true,"severity":2,"message":"311"},{"ruleId":null,"fatal":true,"severity":2,"message":"312"},{"ruleId":null,"fatal":true,"severity":2,"message":"313"},{"ruleId":null,"fatal":true,"severity":2,"message":"314"},{"ruleId":null,"fatal":true,"severity":2,"message":"315"},{"ruleId":null,"fatal":true,"severity":2,"message":"316"},{"ruleId":null,"fatal":true,"severity":2,"message":"317"},{"ruleId":null,"fatal":true,"severity":2,"message":"318"},{"ruleId":null,"fatal":true,"severity":2,"message":"319"},{"ruleId":null,"fatal":true,"severity":2,"message":"320"},{"ruleId":null,"fatal":true,"severity":2,"message":"321"},{"ruleId":null,"fatal":true,"severity":2,"message":"322"},{"ruleId":null,"fatal":true,"severity":2,"message":"323"},{"ruleId":null,"fatal":true,"severity":2,"message":"324"},{"ruleId":null,"fatal":true,"severity":2,"message":"325"},{"ruleId":null,"fatal":true,"severity":2,"message":"326"},"Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: fixtures/sample/types.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'esnext'.","Parsing error: \"parserOptions.project\" has been provided for @typescript-eslint/parser.\nThe file was not found in any of the provided project(s): src/test/builder.spec.ts","Parsing error: \"parserOptions.project\" has been provided for @typescript-eslint/parser.\nThe file was not found in any of the provided project(s): src/test/common/data.ts","Parsing error: \"parserOptions.project\" has been provided for @typescript-eslint/parser.\nThe file was not found in any of the provided project(s): src/test/common/helper.ts","Parsing error: \"parserOptions.project\" has been provided for @typescript-eslint/parser.\nThe file was not found in any of the provided project(s): src/test/vibrant.spec.ts","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/builder.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/builder.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/color.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/color.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/default.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/default.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/filter/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/default.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/default.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/generator/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/base.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/base.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/sharp.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/image/sharp.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/index.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/index.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/mmcq.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/mmcq.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/pqueue.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/pqueue.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/vbox.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/quantizer/vbox.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/typing.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/typing.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/util.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/util.js.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/vibrant.d.ts.\nThe file must be included in at least one of the projects provided.","Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: lib/vibrant.js.\nThe file must be included in at least one of the projects provided."]
|
package/.vscode/settings.json
CHANGED
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ export interface Filter {
|
|
|
111
111
|
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
##### `getPalette(cb?: Callback<PaletteResult>): Promise<PaletteResult>`
|
|
115
115
|
|
|
116
116
|
Name | Description
|
|
117
117
|
---- | -----------------
|
|
@@ -125,10 +125,26 @@ export interface Callback<T> {
|
|
|
125
125
|
}
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
Alias of `getPalette`.
|
|
128
|
+
##### `ImageDimensions`
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
```ts
|
|
131
|
+
interface ImageDimensions {
|
|
132
|
+
readonly width: number
|
|
133
|
+
readonly height: number
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
##### `PaletteResult`
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
interface PaletteResult {
|
|
141
|
+
readonly pixelCount: number
|
|
142
|
+
readonly imageDimensions: ImageDimensions
|
|
143
|
+
readonly palette: Palette
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### `Vibrant.Builder`
|
|
132
148
|
Helper class for change configurations and create a `Vibrant` instance. Methods of a `Builder` instance can be chained like:
|
|
133
149
|
|
|
134
150
|
```ts
|
|
@@ -137,7 +153,7 @@ Vibrant.from(src)
|
|
|
137
153
|
.clearFilters()
|
|
138
154
|
// ...
|
|
139
155
|
.getPalette()
|
|
140
|
-
.then((
|
|
156
|
+
.then((paletteResult) => {})
|
|
141
157
|
```
|
|
142
158
|
|
|
143
159
|
#### `constructor(src: ImageSource, opts: Partial<Options>)`
|
|
@@ -173,12 +189,9 @@ Sets `opts.generator` to `generator`. Returns this `Builder` instance.
|
|
|
173
189
|
#### `build(): Vibrant`
|
|
174
190
|
Builds and returns a `Vibrant` instance as configured.
|
|
175
191
|
|
|
176
|
-
#### `getPalette(cb?: Callback<
|
|
192
|
+
#### `getPalette(cb?: Callback<PaletteResult>): Promise<PaletteResult>`
|
|
177
193
|
Builds a `Vibrant` instance as configured and calls its `getPalette` method.
|
|
178
194
|
|
|
179
|
-
#### `getSwatches(cb? Callback<Palette>): Promise<Palette>`
|
|
180
|
-
Alias of `getPalette`.
|
|
181
|
-
|
|
182
195
|
### `Vibrant.Swatch`
|
|
183
196
|
Represents a color swatch generated from an image's palette.
|
|
184
197
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "1.jpg",
|
|
4
|
+
"dimensions": {
|
|
5
|
+
"width": 640,
|
|
6
|
+
"height": 426
|
|
7
|
+
},
|
|
4
8
|
"palettes": {
|
|
5
9
|
"node": {
|
|
6
10
|
"Vibrant": {
|
|
@@ -56,6 +60,10 @@
|
|
|
56
60
|
},
|
|
57
61
|
{
|
|
58
62
|
"name": "2.jpg",
|
|
63
|
+
"dimensions": {
|
|
64
|
+
"width": 640,
|
|
65
|
+
"height": 426
|
|
66
|
+
},
|
|
59
67
|
"palettes": {
|
|
60
68
|
"node": {
|
|
61
69
|
"Vibrant": {
|
|
@@ -111,6 +119,10 @@
|
|
|
111
119
|
},
|
|
112
120
|
{
|
|
113
121
|
"name": "3.jpg",
|
|
122
|
+
"dimensions": {
|
|
123
|
+
"width": 640,
|
|
124
|
+
"height": 426
|
|
125
|
+
},
|
|
114
126
|
"palettes": {
|
|
115
127
|
"node": {
|
|
116
128
|
"Vibrant": {
|
|
@@ -166,6 +178,10 @@
|
|
|
166
178
|
},
|
|
167
179
|
{
|
|
168
180
|
"name": "4.jpg",
|
|
181
|
+
"dimensions": {
|
|
182
|
+
"width": 640,
|
|
183
|
+
"height": 426
|
|
184
|
+
},
|
|
169
185
|
"palettes": {
|
|
170
186
|
"node": {
|
|
171
187
|
"Vibrant": {
|
package/fixtures/sample/types.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Palette } from '../../src/color';
|
|
1
|
+
import type { Palette } from '../../src/color';
|
|
2
|
+
import type { Sharp } from 'sharp';
|
|
3
|
+
import type { ImageDimensions } from '../../src/typing';
|
|
2
4
|
|
|
3
5
|
export interface Sample {
|
|
4
|
-
name: string
|
|
5
|
-
|
|
6
|
+
name: string
|
|
7
|
+
sharp: Sharp
|
|
8
|
+
filePath: string
|
|
9
|
+
dimensions: ImageDimensions
|
|
6
10
|
palettes: {
|
|
7
|
-
[env: string]: Palette
|
|
11
|
+
[env: string]: Palette
|
|
8
12
|
};
|
|
9
13
|
}
|
|
10
14
|
|
package/lib/builder.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Callback, ImageClass, ImageSource, Options, Filter, Quantizer, Generator } from './typing';
|
|
2
|
-
import type { Palette } from './color';
|
|
1
|
+
import type { Callback, ImageClass, ImageSource, Options, Filter, Quantizer, Generator, PaletteResult } from './typing';
|
|
3
2
|
import Vibrant from './vibrant';
|
|
4
3
|
export default class Builder {
|
|
5
4
|
#private;
|
|
@@ -14,6 +13,5 @@ export default class Builder {
|
|
|
14
13
|
useGenerator(generator: Generator<any>): Builder;
|
|
15
14
|
useQuantizer(quantizer: Quantizer): Builder;
|
|
16
15
|
build(): Vibrant;
|
|
17
|
-
getPalette(cb?: Callback<
|
|
18
|
-
getSwatches(cb?: Callback<Palette>): Promise<Palette>;
|
|
16
|
+
getPalette(cb?: Callback<PaletteResult>): Promise<PaletteResult>;
|
|
19
17
|
}
|
package/lib/builder.js
CHANGED
|
@@ -1,85 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (!
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
privateMap.set(receiver, value);
|
|
7
|
-
return value;
|
|
8
|
-
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
-
if (!privateMap.has(receiver)) {
|
|
11
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
-
}
|
|
13
|
-
return privateMap.get(receiver);
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14
6
|
};
|
|
15
|
-
var
|
|
16
|
-
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
11
|
};
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
var _Builder_src, _Builder_opts;
|
|
20
13
|
// eslint-disable-next-line import/no-cycle
|
|
21
|
-
|
|
14
|
+
import Vibrant from './vibrant';
|
|
22
15
|
class Builder {
|
|
23
16
|
constructor(src, opts = {}) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
__classPrivateFieldSet(this,
|
|
27
|
-
__classPrivateFieldSet(this,
|
|
28
|
-
if (
|
|
29
|
-
__classPrivateFieldGet(this,
|
|
17
|
+
_Builder_src.set(this, void 0);
|
|
18
|
+
_Builder_opts.set(this, void 0);
|
|
19
|
+
__classPrivateFieldSet(this, _Builder_src, src, "f");
|
|
20
|
+
__classPrivateFieldSet(this, _Builder_opts, opts, "f");
|
|
21
|
+
if (Vibrant.DefaultOpts.filters) {
|
|
22
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").filters = [...Vibrant.DefaultOpts.filters];
|
|
30
23
|
}
|
|
31
24
|
else {
|
|
32
|
-
__classPrivateFieldGet(this,
|
|
25
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").filters = [];
|
|
33
26
|
}
|
|
34
27
|
}
|
|
35
28
|
maxColorCount(n) {
|
|
36
|
-
__classPrivateFieldGet(this,
|
|
29
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").colorCount = n;
|
|
37
30
|
return this;
|
|
38
31
|
}
|
|
39
32
|
maxDimension(d) {
|
|
40
|
-
__classPrivateFieldGet(this,
|
|
33
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").maxDimension = d;
|
|
41
34
|
return this;
|
|
42
35
|
}
|
|
43
36
|
addFilter(f) {
|
|
44
|
-
__classPrivateFieldGet(this,
|
|
37
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").filters.push(f);
|
|
45
38
|
return this;
|
|
46
39
|
}
|
|
47
40
|
removeFilter(f) {
|
|
48
|
-
const i = __classPrivateFieldGet(this,
|
|
41
|
+
const i = __classPrivateFieldGet(this, _Builder_opts, "f").filters.indexOf(f);
|
|
49
42
|
if (i > 0)
|
|
50
|
-
__classPrivateFieldGet(this,
|
|
43
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").filters.splice(i);
|
|
51
44
|
return this;
|
|
52
45
|
}
|
|
53
46
|
clearFilters() {
|
|
54
|
-
__classPrivateFieldGet(this,
|
|
47
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").filters = [];
|
|
55
48
|
return this;
|
|
56
49
|
}
|
|
57
50
|
quality(q) {
|
|
58
|
-
__classPrivateFieldGet(this,
|
|
51
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").quality = q;
|
|
59
52
|
return this;
|
|
60
53
|
}
|
|
61
54
|
useImageClass(imageClass) {
|
|
62
|
-
__classPrivateFieldGet(this,
|
|
55
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").ImageClass = imageClass;
|
|
63
56
|
return this;
|
|
64
57
|
}
|
|
65
58
|
useGenerator(generator) {
|
|
66
|
-
__classPrivateFieldGet(this,
|
|
59
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").generator = generator;
|
|
67
60
|
return this;
|
|
68
61
|
}
|
|
69
62
|
useQuantizer(quantizer) {
|
|
70
|
-
__classPrivateFieldGet(this,
|
|
63
|
+
__classPrivateFieldGet(this, _Builder_opts, "f").quantizer = quantizer;
|
|
71
64
|
return this;
|
|
72
65
|
}
|
|
73
66
|
build() {
|
|
74
|
-
return new
|
|
67
|
+
return new Vibrant(__classPrivateFieldGet(this, _Builder_src, "f"), __classPrivateFieldGet(this, _Builder_opts, "f"));
|
|
75
68
|
}
|
|
76
69
|
getPalette(cb) {
|
|
77
70
|
return this.build().getPalette(cb);
|
|
78
71
|
}
|
|
79
|
-
getSwatches(cb) {
|
|
80
|
-
return this.build().getPalette(cb);
|
|
81
|
-
}
|
|
82
72
|
}
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
_Builder_src = new WeakMap(), _Builder_opts = new WeakMap();
|
|
74
|
+
export default Builder;
|
|
85
75
|
//# sourceMappingURL=builder.js.map
|
package/lib/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,2CAA2C;AAC3C,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,MAAqB,OAAO;IAK1B,YAAY,GAAgB,EAAE,OAAyB,EAAE;QAJzD,+BAAkB;QAElB,gCAAwB;QAGtB,uBAAA,IAAI,gBAAQ,GAAG,MAAA,CAAC;QAChB,uBAAA,IAAI,iBAAS,IAAI,MAAA,CAAC;QAElB,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAChC,uBAAA,IAAI,qBAAM,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,uBAAA,IAAI,qBAAM,CAAC,OAAO,GAAG,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,aAAa,CAAC,CAAS;QACrB,uBAAA,IAAI,qBAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,CAAS;QACpB,uBAAA,IAAI,qBAAM,CAAC,YAAY,GAAG,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,CAAS;QACjB,uBAAA,IAAI,qBAAM,CAAC,OAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,CAAS;QACpB,MAAM,CAAC,GAAG,uBAAA,IAAI,qBAAM,CAAC,OAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC;YAAE,uBAAA,IAAI,qBAAM,CAAC,OAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY;QACV,uBAAA,IAAI,qBAAM,CAAC,OAAO,GAAG,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,CAAS;QACf,uBAAA,IAAI,qBAAM,CAAC,OAAO,GAAG,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,UAAsB;QAClC,uBAAA,IAAI,qBAAM,CAAC,UAAU,GAAG,UAAU,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAyB;QACpC,uBAAA,IAAI,qBAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAoB;QAC/B,uBAAA,IAAI,qBAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,OAAO,CAAC,uBAAA,IAAI,oBAAK,EAAE,uBAAA,IAAI,qBAAM,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,EAA4B;QACrC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;CACF;;eArEoB,OAAO"}
|
package/lib/color.d.ts
CHANGED