{"_id":"@andbc/tweakpane-cosine-gradient","_rev":"4-c772247f51e15a23d562ce7b4ba9d7c1","name":"@andbc/tweakpane-cosine-gradient","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@andbc/tweakpane-cosine-gradient","version":"0.0.1","keywords":["tweakpane","plugin","ui","library","gradient","cosine"],"author":{"name":"Andy Duboc"},"license":"MIT","_id":"@andbc/tweakpane-cosine-gradient@0.0.1","maintainers":[{"name":"andbc","email":"a@andbc.co"}],"homepage":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient#readme","bugs":{"url":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient/issues"},"dist":{"shasum":"6c6762a5d07eb3979b0140a2e448ca29af728606","tarball":"https://registry.npmjs.org/@andbc/tweakpane-cosine-gradient/-/tweakpane-cosine-gradient-0.0.1.tgz","fileCount":6,"integrity":"sha512-BftBzeSyolGgVm06MIDQ04vsiV/16FBzx6cg8uNEORSIaotFvv6S1NxD5C2mZuYfK5h7pgp2iWJWK/xNA1B3nw==","signatures":[{"sig":"MEYCIQCJH6D2DkvP2vxYI/MzrQuty0t1UbBasQ9ClSrvS1BqiQIhAKWfu/nbe7fNEyCSfz/DbvvGBjQWYpFATh4S7ROCjknj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19609},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"18093b55440f4108c6432cafb181609747b8327c","scripts":{"clean":"rm -rf ./dist rm -rf ./dist-example","build:lib":"vite build --config vite.config.lib.ts","dev:example":"vite --config vite.config.example.ts","build:example":"vite build --config vite.config.example.ts"},"_npmUser":{"name":"andbc","email":"a@andbc.co"},"repository":{"url":"git+https://github.com/andydbc/tweakpane-plugin-cosine-gradient.git","type":"git"},"_npmVersion":"10.9.2","description":"![banner](https://github.com/andydbc/tweakpane-plugin-cosine-gradient/raw/main/preview.png)","directories":{},"_nodeVersion":"23.11.0","dependencies":{"tweakpane":"^4.0.5"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c","devDependencies":{"vite":"^7.1.7","typescript":"~5.9.3","@types/node":"^24.10.1","@tweakpane/core":"^2.0.5","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/tweakpane-cosine-gradient_0.0.1_1764181869621_0.3816489369928513","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@andbc/tweakpane-cosine-gradient","version":"0.0.2","keywords":["tweakpane","plugin","ui","library","gradient","cosine"],"author":{"name":"Andy Duboc"},"license":"MIT","_id":"@andbc/tweakpane-cosine-gradient@0.0.2","maintainers":[{"name":"andbc","email":"a@andbc.co"}],"homepage":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient#readme","bugs":{"url":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient/issues"},"dist":{"shasum":"c2e47b6f18fb4aa83695d68ea9fa6e7fcd20d2ff","tarball":"https://registry.npmjs.org/@andbc/tweakpane-cosine-gradient/-/tweakpane-cosine-gradient-0.0.2.tgz","fileCount":6,"integrity":"sha512-TfX4hfqVRYZ/D7knM2/ft3PqHjY+SW7HI8nvQLqOYZWBmP0FjmQ19SodYLtQe0c6P65Sxc0ETl7yD+wslinRnA==","signatures":[{"sig":"MEUCIQCuI1MRIFofc4QyII4WIJnPxKOWi8Fu8XvCukNB00SpwQIgINSOqmtYstvwUOaPJlRJCe5OFGOT35l2OHkso2BIYcc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19616},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"b6f22f649bd47b5f89be06c554268262438e4e19","scripts":{"clean":"rm -rf ./dist rm -rf ./dist-example","build:lib":"vite build --config vite.config.lib.ts","dev:example":"vite --config vite.config.example.ts","build:example":"vite build --config vite.config.example.ts"},"_npmUser":{"name":"andbc","email":"a@andbc.co"},"repository":{"url":"git+https://github.com/andydbc/tweakpane-plugin-cosine-gradient.git","type":"git"},"_npmVersion":"10.9.2","description":"![banner](https://github.com/andydbc/tweakpane-plugin-cosine-gradient/raw/main/preview.png)","directories":{},"_nodeVersion":"23.11.0","dependencies":{"tweakpane":"^4.0.5"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c","devDependencies":{"vite":"^7.1.7","typescript":"~5.9.3","@types/node":"^24.10.1","@tweakpane/core":"^2.0.5","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/tweakpane-cosine-gradient_0.0.2_1764182583929_0.7375925069555103","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@andbc/tweakpane-cosine-gradient","version":"0.0.3","keywords":["tweakpane","plugin","ui","library","gradient","cosine"],"author":{"name":"Andy Duboc"},"license":"MIT","_id":"@andbc/tweakpane-cosine-gradient@0.0.3","maintainers":[{"name":"andbc","email":"a@andbc.co"}],"homepage":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient#readme","bugs":{"url":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient/issues"},"dist":{"shasum":"f371fe966554ba6d7d7fe19cfd2a8139750f75a8","tarball":"https://registry.npmjs.org/@andbc/tweakpane-cosine-gradient/-/tweakpane-cosine-gradient-0.0.3.tgz","fileCount":6,"integrity":"sha512-RdlSrlDaLUodq5+yNV/I8DYR6tuNJelb76HcuEVkJrz7lBARfLGJDfQZgjdZXhf5ByHxn2uTWGFTDfGQ9Wafaw==","signatures":[{"sig":"MEUCIQD0QG3PO7aZDlfehoMigTP2j/xLDIoD2EpoNRk1x4qaHAIgTyMoC/XtPwZy0ldJx90uwJ6WkoD5caryRtvGEnmGS8E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22941},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"6c523a0d1f9d95cf1a932d3da7c190f61fe6db3d","scripts":{"clean":"rm -rf ./dist rm -rf ./dist-example","build:lib":"vite build --config vite.config.lib.ts","dev:example":"vite --config vite.config.example.ts","build:example":"vite build --config vite.config.example.ts"},"_npmUser":{"name":"andbc","email":"a@andbc.co"},"repository":{"url":"git+https://github.com/andydbc/tweakpane-plugin-cosine-gradient.git","type":"git"},"_npmVersion":"11.6.2","description":"![banner](https://github.com/andydbc/tweakpane-plugin-cosine-gradient/raw/main/preview.png)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"tweakpane":"^4.0.5"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c","devDependencies":{"vite":"^7.1.7","typescript":"~5.9.3","@types/node":"^24.10.1","@tweakpane/core":"^2.0.5","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/tweakpane-cosine-gradient_0.0.3_1768235818059_0.8065693989997236","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@andbc/tweakpane-cosine-gradient","version":"0.0.4","author":{"name":"Andy Duboc"},"license":"MIT","keywords":["tweakpane","plugin","ui","library","gradient","cosine"],"repository":{"type":"git","url":"git+https://github.com/andydbc/tweakpane-plugin-cosine-gradient.git"},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","main":"dist/index.cjs","scripts":{"clean":"rm -rf ./dist rm -rf ./dist-example","dev:example":"vite --config vite.config.example.ts","build:example":"vite build --config vite.config.example.ts","build:lib":"vite build --config vite.config.lib.ts"},"devDependencies":{"@tweakpane/core":"^2.0.5","@types/node":"^24.10.1","typescript":"~5.9.3","vite":"^7.1.7","vite-plugin-dts":"^4.5.4"},"dependencies":{"tweakpane":"^4.0.5"},"packageManager":"yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c","gitHead":"7fb6ab86f6232b1a8e55a399086dcc4dfa9b364c","_id":"@andbc/tweakpane-cosine-gradient@0.0.4","description":"![banner](https://github.com/andydbc/tweakpane-plugin-cosine-gradient/raw/main/preview.png)","bugs":{"url":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient/issues"},"homepage":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient#readme","_nodeVersion":"24.12.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-SpWrcDB+NinBX6USTjABT8KlBqDE9itQQXYRCuYTer9EAzVt1WynZLyUC6JIGX6qakn4CWEaVl3zmIdmrw7/Bg==","shasum":"2122c19b1dd494e0dd55b8660aa378e3843d4a8c","tarball":"https://registry.npmjs.org/@andbc/tweakpane-cosine-gradient/-/tweakpane-cosine-gradient-0.0.4.tgz","fileCount":6,"unpackedSize":23043,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBqP4Dv7IzDTGrZEmahaFByuQEZrv+AAo4S2M6cto4O1AiEAwupGXt9N9FWENC0c2sefXTXjmnMueYm6ShZULKw7zsA="}]},"_npmUser":{"name":"andbc","email":"a@andbc.co"},"directories":{},"maintainers":[{"name":"andbc","email":"a@andbc.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tweakpane-cosine-gradient_0.0.4_1769882190887_0.39761260299024404"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-26T18:31:09.510Z","modified":"2026-01-31T17:56:31.172Z","0.0.1":"2025-11-26T18:31:09.819Z","0.0.2":"2025-11-26T18:43:04.191Z","0.0.3":"2026-01-12T16:36:58.205Z","0.0.4":"2026-01-31T17:56:31.042Z"},"bugs":{"url":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient/issues"},"author":{"name":"Andy Duboc"},"license":"MIT","homepage":"https://github.com/andydbc/tweakpane-plugin-cosine-gradient#readme","keywords":["tweakpane","plugin","ui","library","gradient","cosine"],"repository":{"type":"git","url":"git+https://github.com/andydbc/tweakpane-plugin-cosine-gradient.git"},"description":"![banner](https://github.com/andydbc/tweakpane-plugin-cosine-gradient/raw/main/preview.png)","maintainers":[{"name":"andbc","email":"a@andbc.co"}],"readme":"# tweakpane-plugin-cosine-gradient\n\n![banner](https://github.com/andydbc/tweakpane-plugin-cosine-gradient/raw/main/preview.png)\n\nCosine gradient controls for [Tweakpane](https://github.com/cocopon/tweakpane/)\n\n[DEMO](https://tweakpane-plugin-cosine-gradient.vercel.app/)\n\n## Installation\n\n```\nnpm install @andbc/tweakpane-cosine-gradient\n```\n\n## Usage\n```typescript\nimport {Pane} from 'tweakpane';\nimport * as CosineGradientPlugin from '@andbc/tweakpane-cosine-gradient';\nimport { CosineGradient, CosineGradientBladeApi } from '@andbc/tweakpane-cosine-gradient';\n\nconst pane = new Pane();\npane.registerPlugin(CosineGradientPlugin);\n\nconst toCSS = (cosineGradient:CosineGradient): string => {\n    const steps = 16;\n    const colorStops: string[] = [];\n    for (let i = 0; i <= steps; i++) {\n        const t = i / steps;\n        const [r, g, b] = cosineGradient.Evaluate(t);\n        colorStops.push(`rgb(${r}, ${g}, ${b}) ${Math.floor(t * 100)}%`);\n    }\n    return `linear-gradient(to right, ${colorStops.join(', ')})`;\n}\n\nconst updateBackground = (gradient: CosineGradient) => {\n    const css = toCSS(gradient);\n    document.body.style.background = css;\n}\n\nconst cosineGradient = new CosineGradient(\n        [0.5, 0.5, 1.0, 0.0],\n        [0.5, 0.5, 1.0, 0.33],\n        [0.5, 0.5, 1.0, 0.67]\n);\n\nvar cosineGradientBlade = pane.addBlade({\n    label: 'Cosine Gradient',\n    view: 'cosineGradient',\n    defaultValue: cosineGradient,\n}) as CosineGradientBladeApi;\n\ncosineGradientBlade.on('change', (ev:TpChangeEvent<CosineGradient>) => {\n    updateBackground(ev.value);\n});\n\n```\n\n## References\nThe plugin is based on an article written by Inigo Quilez. See the [original article](https://iquilezles.org/articles/palettes/).\n","readmeFilename":"README.md"}