Skip to content

Commit

Permalink
Fixed typo (saadeghi#1028)
Browse files Browse the repository at this point in the history
* fix: grammatical errors

* updated keys to match en.json

* fixed: Typo

* Revert "fixed: Typo"

This reverts commit 90499cc.

* fixed: Typo

* Revert "fixed: Typo"

This reverts commit 7aa377e.

* fix typo
  • Loading branch information
WickedInvi authored and ImgBotApp committed Jun 5, 2023
1 parent 67a2d6c commit 3eb60cb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/colors/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const colorNames = require("./colorNames");

module.exports = {

generateForegorundColorFrom: function (input, percentage = 0.8) {
generateForegroundColorFrom: function (input, percentage = 0.8) {
if (Color(input).isDark()) {
let arr = Color(input).mix(Color("white"), percentage).saturate(10).hsl().round().array()
return arr[0] + " " + arr[1] + "%" + " " + arr[2] + "%";
Expand Down Expand Up @@ -81,51 +81,51 @@ module.exports = {

// auto generate content colors
if (!input.hasOwnProperty("base-content")) {
resultObj["--bc"] = this.generateForegorundColorFrom(input["base-100"])
resultObj["--bc"] = this.generateForegroundColorFrom(input["base-100"])
}
if (!input.hasOwnProperty("primary-content")) {
resultObj["--pc"] = this.generateForegorundColorFrom(input["primary"])
resultObj["--pc"] = this.generateForegroundColorFrom(input["primary"])
}

if (!input.hasOwnProperty("secondary-content")) {
resultObj["--sc"] = this.generateForegorundColorFrom(input["secondary"])
resultObj["--sc"] = this.generateForegroundColorFrom(input["secondary"])
}

if (!input.hasOwnProperty("accent-content")) {
resultObj["--ac"] = this.generateForegorundColorFrom(input["accent"])
resultObj["--ac"] = this.generateForegroundColorFrom(input["accent"])
}

if (!input.hasOwnProperty("neutral-content")) {
resultObj["--nc"] = this.generateForegorundColorFrom(input["neutral"])
resultObj["--nc"] = this.generateForegroundColorFrom(input["neutral"])
}

if (!input.hasOwnProperty("info-content")) {
if (input.hasOwnProperty("info")) {
resultObj["--inc"] = this.generateForegorundColorFrom(input["info"])
resultObj["--inc"] = this.generateForegroundColorFrom(input["info"])
} else {
resultObj["--inc"] = 198 + " " + 100 + "%" + " " + 12 + "%";
}
}

if (!input.hasOwnProperty("success-content")) {
if (input.hasOwnProperty("success")) {
resultObj["--suc"] = this.generateForegorundColorFrom(input["success"])
resultObj["--suc"] = this.generateForegroundColorFrom(input["success"])
} else {
resultObj["--suc"] = 158 + " " + 100 + "%" + " " + 10 + "%";
}
}

if (!input.hasOwnProperty("warning-content")) {
if (input.hasOwnProperty("warning")) {
resultObj["--wac"] = this.generateForegorundColorFrom(input["warning"])
resultObj["--wac"] = this.generateForegroundColorFrom(input["warning"])
} else {
resultObj["--wac"] = 43 + " " + 100 + "%" + " " + 11 + "%";
}
}

if (!input.hasOwnProperty("error-content")) {
if (input.hasOwnProperty("error")) {
resultObj["--erc"] = this.generateForegorundColorFrom(input["error"])
resultObj["--erc"] = this.generateForegroundColorFrom(input["error"])
} else {
resultObj["--erc"] = 0 + " " + 100 + "%" + " " + 14 + "%";
}
Expand Down

0 comments on commit 3eb60cb

Please sign in to comment.