discordjs-colors-bundle
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "discordjs-colors-bundle", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Tons of colors for your DiscordJS bot's embed", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -21,3 +21,3 @@ # 🌈 DiscordJS Colors Bundle | ||
- More than 25 unique colors | ||
- More than 50 unique colors | ||
- Zero-Dependency module | ||
@@ -24,0 +24,0 @@ - Light weight |
@@ -0,7 +1,17 @@ | ||
function getRandomHexColor() { | ||
let letters = "0123456789ABCDEF"; | ||
let color = "0x"; | ||
for (let i = 0; i < 6; i++) { | ||
color += letters[Math.floor(Math.random() * 16)]; | ||
} | ||
return parseInt(color, 16); | ||
} | ||
/** | ||
* - The color object for Discord.js | ||
* - It has 30 colors | ||
* - It has more than 50 colors | ||
* - It only works with Discord.js | ||
*/ | ||
const colors = { | ||
const colors = { | ||
Red: 0xff0000, | ||
@@ -33,6 +43,27 @@ Orange: 0xffa500, | ||
LightSeaGreen: 0x20b2aa, | ||
SkyBlue: 0x87CEEB, | ||
LightSkyBlue: 0x87CEEB, | ||
SpringGreen: 0x00FF7F, | ||
Tomato: 0xFF6347, | ||
SkyBlue: 0x87ceeb, | ||
LightSkyBlue: 0x87ceeb, | ||
SpringGreen: 0x00ff7f, | ||
Tomato: 0xff6347, | ||
Chartreuse: 0xdfff00, | ||
DarkChartreuse: 0x7fff00, | ||
SandyBrown: 0xf4a460, | ||
Plum: 0x673147, | ||
MysticMauve: 0xb699ae, | ||
ElectricKiwi: 0xcfff04, | ||
VelvetMaroon: 0x800020, | ||
TurquoiseSurf: 0x00c5cd, | ||
MidnightSun: 0xffcb6b, | ||
CherryBlossomPink: 0xffb7c5, | ||
LavenderHaze: 0xb57edc, | ||
CaramelLatte: 0xaf6f09, | ||
Goldenrod: 0xdaa520, | ||
IndigoNight: 0x4b0082, | ||
SeafoamSplash: 0x00ffc6, | ||
LimeFizz: 0x9acd32, | ||
SapphireDepths: 0x082567, | ||
MintMist: 0xb0e0e6, | ||
FrostyFern: 0x4f7942, | ||
MidnightMarina: 0x003366, | ||
RandomAdvanced: getRandomHexColor(), | ||
Colors: { | ||
@@ -65,6 +96,27 @@ Red: 0xff0000, | ||
LightSeaGreen: 0x20b2aa, | ||
SkyBlue: 0x87CEEB, | ||
LightSkyBlue: 0x87CEEB, | ||
SpringGreen: 0x00FF7F, | ||
Tomato: 0xFF6347 | ||
SkyBlue: 0x87ceeb, | ||
LightSkyBlue: 0x87ceeb, | ||
SpringGreen: 0x00ff7f, | ||
Tomato: 0xff6347, | ||
Chartreuse: 0xdfff00, | ||
DarkChartreuse: 0x7fff00, | ||
SandyBrown: 0xf4a460, | ||
Plum: 0x673147, | ||
MysticMauve: 0xb699ae, | ||
ElectricKiwi: 0xcfff04, | ||
VelvetMaroon: 0x800020, | ||
TurquoiseSurf: 0x00c5cd, | ||
MidnightSun: 0xffcb6b, | ||
CherryBlossomPink: 0xffb7c5, | ||
LavenderHaze: 0xb57edc, | ||
CaramelLatte: 0xaf6f09, | ||
Goldenrod: 0xdaa520, | ||
IndigoNight: 0x4b0082, | ||
SeafoamSplash: 0x00ffc6, | ||
LimeFizz: 0x9acd32, | ||
SapphireDepths: 0x082567, | ||
MintMist: 0xb0e0e6, | ||
FrostyFern: 0x4f7942, | ||
MidnightMarina: 0x003366, | ||
RandomAdvanced: getRandomHexColor(), | ||
}, | ||
@@ -99,7 +151,27 @@ }; | ||
"SeaBlue", | ||
"LightSeaGreen", | ||
"LightSeaGreen", | ||
"SkyBlue", | ||
"LightSkyBlue", | ||
"SpringGreen", | ||
"Tomato" | ||
"Tomato", | ||
"Chartreuse", | ||
"DarkChartreuse", | ||
"SandyBrown", | ||
"Plum", | ||
"MysticMauve", | ||
"ElectricKiwi", | ||
"VelvetMaroon", | ||
"TurquoiseSurf", | ||
"MidnightSun", | ||
"CherryBlossomPink", | ||
"LavenderHaze", | ||
"CaramelLatte", | ||
"Goldenrod", | ||
"IndigoNight", | ||
"SeafoamSplash", | ||
"LimeFizz", | ||
"SapphireDepths", | ||
"MintMist", | ||
"FrostyFern", | ||
"MidnightMarina", | ||
]; | ||
@@ -115,3 +187,3 @@ | ||
/** | ||
* - 30 Colors | ||
* - 50 Colors | ||
* @param {number} amount | ||
@@ -125,9 +197,9 @@ * @returns all the colors name | ||
function colorNames(amount = 30) { | ||
if (amount < 0 || amount > 30) { | ||
function colorNames(amount = 50) { | ||
if (amount < 0 || amount > 50) { | ||
throw new AmountError( | ||
`Whoa there, hold on a sec! We've got a problem here. The amount you entered is not within the acceptable range. It should be between 0 and 30, but you entered ${amount}. Let's try that again with a value within the specified range, shall we?` | ||
`Whoa there, hold on a sec! We've got a problem here. The amount you entered is not within the acceptable range. It should be between 0 and 50, but you entered ${amount}. Let's try that again with a value within the specified range, shall we?` | ||
); | ||
} | ||
if (typeof amount !== "number" || typeof amount !== "undefined") { | ||
if (typeof amount !== "number") { | ||
throw new TypeError( | ||
@@ -134,0 +206,0 @@ `Expected type to be "number" but got "${typeof amount}" instead.` |
@@ -1,7 +0,53 @@ | ||
/** | ||
* - The color type for Discord.js | ||
* - It has 30 colors with number type | ||
*/ | ||
declare function getRandomHexColor(): number; | ||
type colorsType = { | ||
declare interface DiscordColors { | ||
Red: number; | ||
Orange: number; | ||
Yellow: number; | ||
Green: number; | ||
Blue: number; | ||
Indigo: number; | ||
Violet: number; | ||
Purple: number; | ||
Lime: number; | ||
LemonJuice: number; | ||
CadetBlue: number; | ||
HotPink: number; | ||
CornFlowerBlue: number; | ||
Brick: number; | ||
OliveDrab: number; | ||
Olive: number; | ||
Coral: number; | ||
LightCoral: number; | ||
Cyan: number; | ||
LightCyan: number; | ||
Aqua: number; | ||
Aquamarine: number; | ||
Salmon: number; | ||
SeaGreen: number; | ||
SeaBlue: number; | ||
LightSeaGreen: number; | ||
SkyBlue: number; | ||
LightSkyBlue: number; | ||
SpringGreen: number; | ||
Tomato: number; | ||
Chartreuse: number; | ||
DarkChartreuse: number; | ||
SandyBrown: number; | ||
Plum: number; | ||
MysticMauve: number; | ||
ElectricKiwi: number; | ||
VelvetMaroon: number; | ||
TurquoiseSurf: number; | ||
MidnightSun: number; | ||
CherryBlossomPink: number; | ||
LavenderHaze: number; | ||
CaramelLatte: number; | ||
Goldenrod: number; | ||
IndigoNight: number; | ||
SeafoamSplash: number; | ||
LimeFizz: number; | ||
SapphireDepths: number; | ||
RandomAdvanced: number; | ||
Colors: { | ||
Red: number; | ||
@@ -37,53 +83,24 @@ Orange: number; | ||
Tomato: number; | ||
Colors: { | ||
Red: number; | ||
Orange: number; | ||
Yellow: number; | ||
Green: number; | ||
Blue: number; | ||
Indigo: number; | ||
Violet: number; | ||
Purple: number; | ||
Lime: number; | ||
LemonJuice: number; | ||
CadetBlue: number; | ||
HotPink: number; | ||
CornFlowerBlue: number; | ||
Brick: number; | ||
OliveDrab: number; | ||
Olive: number; | ||
Coral: number; | ||
LightCoral: number; | ||
Cyan: number; | ||
LightCyan: number; | ||
Aqua: number; | ||
Aquamarine: number; | ||
Salmon: number; | ||
SeaGreen: number; | ||
SeaBlue: number; | ||
LightSeaGreen: number; | ||
SkyBlue: number; | ||
LightSkyBlue: number; | ||
SpringGreen: number; | ||
Tomato: number; | ||
}; | ||
Chartreuse: number; | ||
DarkChartreuse: number; | ||
SandyBrown: number; | ||
Plum: number; | ||
MysticMauve: number; | ||
ElectricKiwi: number; | ||
VelvetMaroon: number; | ||
TurquoiseSurf: number; | ||
MidnightSun: number; | ||
CherryBlossomPink: number; | ||
LavenderHaze: number; | ||
CaramelLatte: number; | ||
Goldenrod: number; | ||
IndigoNight: number; | ||
SeafoamSplash: number; | ||
LimeFizz: number; | ||
SapphireDepths: number; | ||
}; | ||
/** | ||
* - The color object for Discord.js | ||
* - It has 30 colors | ||
* - It only works with Discord.js | ||
*/ | ||
declare const colors: colorsType; | ||
/** | ||
* - 30 Colors | ||
* @param {number} amount | ||
* @returns all the colors name | ||
* @example ```js | ||
* console.log(colorNames(10)); // It'll log the first 10 colors | ||
* console.log(colorNames()); // It'll log all the colors | ||
* ``` | ||
*/ | ||
declare function colorNames(amount?: number): string; | ||
export { colors, colorNames }; | ||
} | ||
declare const colors: DiscordColors; | ||
export { getRandomHexColor, colors }; |
10211
308