diff --git a/README.md b/README.md index 6bb22a5..7c99d41 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,21 @@ npm install --save palettey ## Usage ```js -import { createPalleteFromColor } from "palettey"; +import { createPaletteFromColor } from "palettey"; // Generate a luminance palette -createPalleteFromColor("primary", "#7953e0", { +createPaletteFromColor("primary", "#7953e0", { useLightness: false, }) // Generate a lightness palette -createPalleteFromColor("primary", "#7953e0", {}) +createPaletteFromColor("primary", "#7953e0", {}) ``` To create css variables for the generated palette you can use: ```js -const palette = createPalleteFromColor("primary", "D20000", {}); +const palette = createPaletteFromColor("primary", "D20000", {}); Object.entries(palette.test).forEach((entry) => { const [step, color] = entry; document.documentElement.style.setProperty( diff --git a/index.d.ts b/index.d.ts index 94d3745..1e4d180 100644 --- a/index.d.ts +++ b/index.d.ts @@ -29,7 +29,7 @@ export interface PaletteOutput { [key: string]: Palette; } -export function createPalleteFromColor( +export function createPaletteFromColor( name: string, baseColor: string, config: PaletteConfig diff --git a/index.js b/index.js index 3cef538..520f60a 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ const { const { DEFAULT_PALETTE_CONFIG } = require("./lib/constants.js"); -const createPalleteFromColor = (name, baseColor, config) => { +const createPaletteFromColor = (name, baseColor, config) => { if (!name || !isValidName(name) || !baseColor || !isHex(baseColor)) { return null; } @@ -94,4 +94,4 @@ const createSwatches = (palette) => { return swatches; }; -module.exports = { createPalleteFromColor }; +module.exports = { createPaletteFromColor }; diff --git a/package.json b/package.json index 055dcd9..d2c4e20 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "palettey", "version": "1.0.2", - "description": "Generate a 10-color pallete from a base color", + "description": "Generate a 10-color palette from a base color", "main": "index.js", "repository": "bartbergmans/palettey", "scripts": { diff --git a/test/index.test.js b/test/index.test.js index 55c8d64..fffcf8a 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -2,7 +2,7 @@ const palettey = require("../index.js"); it("generates a palette based on a color", () => { expect( - palettey.createPalleteFromColor("primary", "#7953e0", {}) + palettey.createPaletteFromColor("primary", "#7953e0", {}) ).toMatchObject({ primary: { 50: "#F1EEFC", @@ -21,7 +21,7 @@ it("generates a palette based on a color", () => { it("generates a luminance palette based on a color", () => { expect( - palettey.createPalleteFromColor("primary", "#7953e0", { + palettey.createPaletteFromColor("primary", "#7953e0", { useLightness: false, }) ).toMatchObject({