@batpb/genart-palettes
Advanced tools
Comparing version 0.3.2 to 0.4.1
@@ -1,2 +0,2 @@ | ||
import { StringMap } from "@batpb/genart-base"; | ||
import { StringMap, Color, ColorSelector } from "@batpb/genart-base"; | ||
interface PaletteColor { | ||
@@ -20,11 +20,35 @@ readonly rgb: { | ||
declare const _006f57: PaletteColor; | ||
declare const _0437f2: PaletteColor; | ||
declare const _0fff4f: PaletteColor; | ||
declare const _121212: PaletteColor; | ||
declare const _1d90af: PaletteColor; | ||
declare const _23856d: PaletteColor; | ||
declare const _3a2112: PaletteColor; | ||
declare const _7a00f5: PaletteColor; | ||
declare const _7dced8: PaletteColor; | ||
declare const _bb010b: PaletteColor; | ||
declare const _cd1624: PaletteColor; | ||
declare const _d01625: PaletteColor; | ||
declare const _ec407a: PaletteColor; | ||
declare const _f06292: PaletteColor; | ||
declare const _f06090: PaletteColor; | ||
declare const _f0f3f4: PaletteColor; | ||
declare const _f48fb1: PaletteColor; | ||
declare const _f8bbd0: PaletteColor; | ||
declare const _f8bacf: PaletteColor; | ||
declare const _faf8f8: PaletteColor; | ||
declare const _fafeff: PaletteColor; | ||
declare const _fce4ec: PaletteColor; | ||
declare const _ff6bb5: PaletteColor; | ||
declare class PaletteColorSelector implements ColorSelector { | ||
private readonly _palette; | ||
private _colors; | ||
private _currentIndex; | ||
private readonly _randomOrder; | ||
constructor(_palette: Palette); | ||
constructor(_palette: Palette, colorCount: number, randomOrder: boolean); | ||
get hasPalette(): boolean; | ||
get name(): string; | ||
get colorNames(): string[]; | ||
getColor(): Color; | ||
private chooseColors; | ||
private incrementCurrentIndex; | ||
} | ||
interface Palette { | ||
@@ -37,10 +61,21 @@ readonly name: string; | ||
declare function addPalettes(palettes: IterableIterator<Palette>, paletteMap: StringMap<Palette>, paletteMapName: string): void; | ||
declare function getPaletteColorSelectors(paletteMap: StringMap<Palette>): Set<PaletteColorSelector>; | ||
declare const allPalettes: StringMap<Palette>; | ||
declare const getAllPaletteColorSelectors: () => Set<PaletteColorSelector>; | ||
declare const holidayPalettes: StringMap<Palette>; | ||
declare const getHolidayColorSelectors: () => Set<PaletteColorSelector>; | ||
declare const christmasPalettes: StringMap<Palette>; | ||
declare const mutedChristmas: Palette; | ||
declare const getChristmasColorSelectors: () => Set<PaletteColorSelector>; | ||
declare const valentinesPalettes: StringMap<Palette>; | ||
declare const glitter: Palette; | ||
declare const getValentinesColorSelectors: () => Set<PaletteColorSelector>; | ||
declare const miscPalettes: StringMap<Palette>; | ||
declare const brittni: Palette; | ||
declare const getMiscColorSelectors: () => Set<PaletteColorSelector>; | ||
declare const naturePalettes: StringMap<Palette>; | ||
declare const blueLily: Palette; | ||
declare const getNatureColorSelectors: () => Set<PaletteColorSelector>; | ||
export type { PaletteColor, Palette }; | ||
export { _006f57, _23856d, _bb010b, _cd1624, _ec407a, _f06292, _f48fb1, _f8bbd0, _faf8f8, _fce4ec, paletteColors, addPalette, addPalettes, allPalettes, holidayPalettes, mutedChristmas, christmasPalettes, glitter, valentinesPalettes }; | ||
export { _006f57, _0437f2, _0fff4f, _121212, _1d90af, _23856d, _3a2112, _7a00f5, _7dced8, _bb010b, _d01625, _ec407a, _f06090, _f0f3f4, _f48fb1, _f8bacf, _faf8f8, _fafeff, _fce4ec, _ff6bb5, paletteColors, addPalette, addPalettes, getPaletteColorSelectors, PaletteColorSelector, allPalettes, getAllPaletteColorSelectors, holidayPalettes, getHolidayColorSelectors, mutedChristmas, christmasPalettes, getChristmasColorSelectors, glitter, valentinesPalettes, getValentinesColorSelectors, brittni, miscPalettes, getMiscColorSelectors, blueLily, naturePalettes, getNatureColorSelectors }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@batpb/genart-base")):"function"==typeof define&&define.amd?define(["exports","@batpb/genart-base"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["genart-palettes"]={},e.genartBase)}(this,(function(e,t){"use strict";const a={rgb:{r:0,g:111,b:87},hsl:{h:167,s:100,l:22},hexString:"#006F57",name:"teal dark green",htmlName:"teal",wikipediaName:"tropical rainforest"},i={rgb:{r:35,g:133,b:109},hsl:{h:165,s:58,l:33},hexString:"#23856D",name:"accent green blue",htmlName:"seagreen",wikipediaName:"myrtle green"},n={rgb:{r:187,g:1,b:11},hsl:{h:357,s:99,l:37},hexString:"#BB010B",name:"bird's eye",htmlName:"firebrick",wikipediaName:"venetian red"},s={rgb:{r:205,g:22,b:36},hsl:{h:355,s:81,l:45},hexString:"#CD1624",name:"cartoon violence",htmlName:"crimson",wikipediaName:"lava"},l={hexString:"#EC407A",rgb:{r:236,g:64,b:122},hsl:{h:340,s:82,l:59},name:"cerise pink",htmlName:"indianred",wikipediaName:"paradise pink"},r={hexString:"#F06292",rgb:{r:240,g:98,b:146},hsl:{h:340,s:83,l:66},name:"medium pink",htmlName:"palevioletred",wikipediaName:"violet-red"},o={hexString:"#F48FB1",rgb:{r:244,g:143,b:177},hsl:{h:340,s:82,l:76},name:"sachet pink",htmlName:"hotpink",wikipediaName:"vanilla ice"},h={hexString:"#F8BBD0",rgb:{r:248,g:187,b:208},hsl:{h:339,s:81,l:85},name:"dahlia delight",htmlName:"pink",wikipediaName:"orchid pink"},m={rgb:{r:250,g:248,b:248},hsl:{h:0,s:17,l:98},hexString:"#FAF8F8",name:"doctor",htmlName:"snow",wikipediaName:"snow"},d={hexString:"#FCE4EC",rgb:{r:252,g:228,b:236},hsl:{h:340,s:80,l:94},name:"hepatica",htmlName:"mistyrose",wikipediaName:"piggy pink"},c=new t.StringMap;function g(e){const t=e.hexString;c.setUndefinedKey(t,e,`color ${t} already exists in palette colors.`)}function p(e,t,a){const i=e.name;t.setUndefinedKey(i,e,`palette ${i} already exists in ${a}.`)}function b(e,t,a){for(const i of e){const e=i.name;t.setUndefinedKey(e,i,`palette ${e} already exists in ${a}.`)}}g(a),g(i),g(n),g(s),g(l),g(r),g(o),g(h),g(m),g(d);const f={name:"muted christmas",source:"https://coolors.co/palette/bb010b-cd1624-006f57-23856d-faf8f8",colors:[n,s,a,i,m]},u=new t.StringMap;p(f,u,"christmas palettes");const k={name:"glitter",source:"https://culrs.com/palette/fce4ecf8bbd0f48fb1f06292ec407a",colors:[d,h,o,r,l]},N=new t.StringMap;p(k,N,"valentine's day palettes");const w=new t.StringMap,x="holiday palettes";b(u.values,w,x),b(N.values,w,x);const y=new t.StringMap;b(w.values,y,"all palettes"),e._006f57=a,e._23856d=i,e._bb010b=n,e._cd1624=s,e._ec407a=l,e._f06292=r,e._f48fb1=o,e._f8bbd0=h,e._faf8f8=m,e._fce4ec=d,e.addPalette=p,e.addPalettes=b,e.allPalettes=y,e.christmasPalettes=u,e.glitter=k,e.holidayPalettes=w,e.mutedChristmas=f,e.paletteColors=c,e.valentinesPalettes=N})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@batpb/genart-base")):"function"==typeof define&&define.amd?define(["exports","@batpb/genart-base"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["genart-palettes"]={},e.genartBase)}(this,(function(e,t){"use strict";const a={rgb:{r:0,g:111,b:87},hsl:{h:167,s:100,l:22},hexString:"#006F57",name:"teal dark green",htmlName:"teal",wikipediaName:"tropical rainforest"},r={hexString:"#0437F2",rgb:{r:4,g:55,b:241},hsl:{h:227,s:97,l:48},name:"vibrant blue",htmlName:"blue",wikipediaName:"blue"},l={hexString:"#0FFF4F",rgb:{r:15,g:255,b:79},hsl:{h:136,s:100,l:53},name:"cathode green",htmlName:"springgreen",wikipediaName:"erin"},n={hexString:"#121212",rgb:{r:18,g:18,b:18},hsl:{h:0,s:0,l:7},name:"dark tone ink",htmlName:"black",wikipediaName:"smoky black"},i={hexString:"#1D90AF",rgb:{r:29,g:144,b:175},hsl:{h:193,s:72,l:40},name:"mediterranean sea",htmlName:"lightseagreen",wikipediaName:"weezy blue"},s={rgb:{r:35,g:133,b:109},hsl:{h:165,s:58,l:33},hexString:"#23856D",name:"accent green blue",htmlName:"seagreen",wikipediaName:"myrtle green"},o={hexString:"#3A2112",rgb:{r:58,g:33,b:18},hsl:{h:23,s:53,l:15},name:"black slug",htmlName:"black; dark sienna",wikipediaName:"dark sienna"},h={hexString:"#7A00F5",rgb:{r:122,g:0,b:245},hsl:{h:270,s:100,l:48},name:"poison purple",htmlName:"darkviolet",wikipediaName:"electric violet"},m={hexString:"#7DCED8",rgb:{r:125,g:206,b:216},hsl:{h:187,s:54,l:67},name:"spray",htmlName:"skyblue",wikipediaName:"middle blue"},c={rgb:{r:187,g:1,b:11},hsl:{h:357,s:99,l:37},hexString:"#BB010B",name:"bird's eye",htmlName:"firebrick",wikipediaName:"venetian red"},g={rgb:{r:208,g:22,b:37},hsl:{h:355,s:81,l:45},hexString:"#D01625",name:"cartoon violence",htmlName:"crimson",wikipediaName:"lava"},d={hexString:"#EC407A",rgb:{r:236,g:64,b:122},hsl:{h:340,s:82,l:59},name:"cerise pink",htmlName:"indianred",wikipediaName:"paradise pink"},p={hexString:"#F06090",rgb:{r:240,g:96,b:144},hsl:{h:340,s:83,l:66},name:"medium pink",htmlName:"palevioletred",wikipediaName:"violet-red"},b={hexString:"#F0F3F4",rgb:{r:240,g:243,b:244},hsl:{h:195,s:15,l:95},name:"zappy zebra",htmlName:"whitesmoke",wikipediaName:"cultured pearl"},f={hexString:"#F48FB1",rgb:{r:244,g:143,b:177},hsl:{h:340,s:82,l:76},name:"sachet pink",htmlName:"hotpink; vanilla ice",wikipediaName:"vanilla ice"},u={hexString:"#F8BACF",rgb:{r:248,g:186,b:207},hsl:{h:339,s:81,l:85},name:"dahlia delight",htmlName:"pink",wikipediaName:"orchid pink"},k={rgb:{r:250,g:248,b:248},hsl:{h:0,s:17,l:98},hexString:"#FAF8F8",name:"doctor",htmlName:"snow",wikipediaName:"snow"},N={hexString:"#FAFEFF",rgb:{r:250,g:254,b:255},hsl:{h:192,s:100,l:99},name:"polar bear in a blizzard",htmlName:"white",wikipediaName:"white"},_={hexString:"#FCE4EC",rgb:{r:252,g:228,b:236},hsl:{h:340,s:80,l:94},name:"hepatica",htmlName:"mistyrose",wikipediaName:"piggy pink"},w={hexString:"#FF6BB5",rgb:{r:255,g:107,b:181},hsl:{h:330,s:100,l:71},name:"fen hong pink",htmlName:"hotpink; hot pink",wikipediaName:"hot pink"},S=new t.StringMap;function x(e){const t=e.hexString;S.setUndefinedKey(t,e,`color ${t} already exists in palette colors.`)}x(a),x(r),x(l),x(n),x(i),x(s),x(o),x(h),x(m),x(c),x(g),x(d),x(p),x(b),x(f),x(u),x(k),x(N),x(_),x(w);const y=t.SketchContext.p5;class F{constructor(e,a,r){this._palette=e,this._colors=[],this._currentIndex=0,this._randomOrder=null!=r?r:t.Random.randomBoolean(),a||(a=t.Random.randomInt(2,this._palette.colors.length+1)),a=y.constrain(a,2,this._palette.colors.length),this.chooseColors(a)}get hasPalette(){return!0}get name(){let e=this._palette.name;return e.toLowerCase().endsWith(" palette")||(e+=" palette"),e}get colorNames(){return this._colors.map((e=>e.name))}getColor(){var e;let a;this._randomOrder?a=null!==(e=t.Random.randomElement(this._colors))&&void 0!==e?e:this._colors[0]:(a=this._colors[this._currentIndex],this.incrementCurrentIndex());const r=y.color(a.hexString);return new t.Color(r)}chooseColors(e){if(e===this._palette.colors.length)this._colors=Array.from(this._palette.colors);else{const a=[];for(let e=0;e<this._palette.colors.length;e++)a.push(e);for(let r=0;r<e;r++){const e=t.Random.randomInt(0,a.length),r=a[e],l=this._palette.colors[r];this._colors.push(l),a.splice(e,1)}}}incrementCurrentIndex(){this._currentIndex=(this._currentIndex+1)%this._colors.length}}function C(e,t,a){const r=e.name;t.setUndefinedKey(r,e,`palette ${r} already exists in ${a}.`)}function v(e,t,a){for(const r of e){const e=r.name;t.setUndefinedKey(e,r,`palette ${e} already exists in ${a}.`)}}function P(e){const t=new Set;for(const a of e.values)t.add(new F(a));return t}const A={name:"muted christmas",source:"https://coolors.co/palette/bb010b-cd1624-006f57-23856d-faf8f8",colors:[c,g,a,s,k]},B=new t.StringMap;C(A,B,"christmas palettes");const I={name:"glitter",source:"https://culrs.com/palette/fce4ecf8bbd0f48fb1f06292ec407a",colors:[_,u,f,p,d]},M=new t.StringMap;C(I,M,"valentine's day palettes");const E=new t.StringMap,z="holiday palettes";v(B.values,E,z),v(M.values,E,z);const D={name:"brittni",source:"brittni",colors:[n,r,w,l,h]},$=new t.StringMap;C(D,$,"miscellaneous palettes");const R={name:"blue lily",source:"https://www.color-hex.com/color-palette/1040636",colors:[b,N,m,i,o]},K=new t.StringMap;C(R,K,"nature palettes");const U=new t.StringMap,L="all palettes";v(E.values,U,L),v($.values,U,L),v(K.values,U,L);e.PaletteColorSelector=F,e._006f57=a,e._0437f2=r,e._0fff4f=l,e._121212=n,e._1d90af=i,e._23856d=s,e._3a2112=o,e._7a00f5=h,e._7dced8=m,e._bb010b=c,e._d01625=g,e._ec407a=d,e._f06090=p,e._f0f3f4=b,e._f48fb1=f,e._f8bacf=u,e._faf8f8=k,e._fafeff=N,e._fce4ec=_,e._ff6bb5=w,e.addPalette=C,e.addPalettes=v,e.allPalettes=U,e.blueLily=R,e.brittni=D,e.christmasPalettes=B,e.getAllPaletteColorSelectors=()=>P(U),e.getChristmasColorSelectors=()=>P(B),e.getHolidayColorSelectors=()=>P(E),e.getMiscColorSelectors=()=>P($),e.getNatureColorSelectors=()=>P(K),e.getPaletteColorSelectors=P,e.getValentinesColorSelectors=()=>P(M),e.glitter=I,e.holidayPalettes=E,e.miscPalettes=$,e.mutedChristmas=A,e.naturePalettes=K,e.paletteColors=S,e.valentinesPalettes=M})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@batpb/genart-palettes", | ||
"version": "0.3.2", | ||
"version": "0.4.1", | ||
"description": "Color palette classes and methods for the brittni and the polar bear generative art library.", | ||
@@ -20,2 +20,3 @@ "main": "./out/index.js", | ||
"test": "rm -r ./out/tests-coverage; jest", | ||
"lint": "eslint ./src", | ||
"prepack": "npm run build:source" | ||
@@ -56,5 +57,5 @@ }, | ||
"dependencies": { | ||
"@batpb/genart-base": "^0.3.2", | ||
"@batpb/genart-base": "^0.4.1", | ||
"@types/p5": "^1.7.6", | ||
"p5": "^1.9.0" | ||
"p5": "^1.9.1" | ||
}, | ||
@@ -65,8 +66,8 @@ "devDependencies": { | ||
"@types/jest": "^29.5.12", | ||
"@typescript-eslint/eslint-plugin": "^7.0.1", | ||
"@typescript-eslint/parser": "^7.0.1", | ||
"@typescript-eslint/eslint-plugin": "^7.3.1", | ||
"@typescript-eslint/parser": "^7.3.1", | ||
"canvas": "^2.11.2", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"rollup": "^4.12.0", | ||
"rollup": "^4.13.0", | ||
"rollup-plugin-analyzer": "^4.0.0", | ||
@@ -77,4 +78,4 @@ "rollup-plugin-ts": "^3.4.5", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.3.3" | ||
"typescript": "^5.4.3" | ||
} | ||
} |
@@ -16,2 +16,4 @@ # Generative Art Library: Color Palettes | ||
[![Socket Badge](https://socket.dev/api/badge/npm/package/@batpb/genart-palettes)](https://socket.dev/npm/package/@batpb/genart-palettes) | ||
![NPM Downloads](https://img.shields.io/npm/dw/%40batpb%2Fgenart-palettes) | ||
@@ -18,0 +20,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
101906
2
105
30
0
+ Added@batpb/genart-base@0.4.1(transitive)
- Removed@batpb/genart-base@0.3.2(transitive)
Updated@batpb/genart-base@^0.4.1
Updatedp5@^1.9.1