Skip to content

Commit

Permalink
Merge pull request #4 from GeorgeCiesinski/master
Browse files Browse the repository at this point in the history
Fix typo in main function
  • Loading branch information
bartbergmans authored Jan 5, 2023
2 parents 3190e44 + cb93ea9 commit bcf0697
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface PaletteOutput {
[key: string]: Palette;
}

export function createPalleteFromColor(
export function createPaletteFromColor(
name: string,
baseColor: string,
config: PaletteConfig
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -94,4 +94,4 @@ const createSwatches = (palette) => {
return swatches;
};

module.exports = { createPalleteFromColor };
module.exports = { createPaletteFromColor };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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({
Expand Down

0 comments on commit bcf0697

Please sign in to comment.