@phun-ky/moebius / MoebiusPalettes
Interface: MoebiusPalettes
Defined in: classes/MoebiusPalettes.ts:23
MoebiusPalettes class representing a set of color palettes and their variations.
Implements
Properties
accents
accents: MoebiusPaletteAccentColorsInterface;Defined in: classes/MoebiusPalettes.ts:34
Implementation of
MoebiusPaletteInterface.accents
all
all: `#${string}`[] = [];Defined in: classes/MoebiusPalettes.ts:33
Implementation of
MoebiusPaletteInterface.all
baseColor
baseColor: MoebiusColorInterface;Defined in: classes/MoebiusPalettes.ts:24
Implementation of
MoebiusPaletteInterface.baseColor
colors
colors: MoebiusPaletteColorsInterface;Defined in: classes/MoebiusPalettes.ts:26
Implementation of
MoebiusPaletteInterface.colors
defaultOptions
defaultOptions: MoebiusPaletteDefaultOptionsType;Defined in: classes/MoebiusPalettes.ts:28
Implementation of
MoebiusPaletteInterface.defaultOptions
options
options: MoebiusPaletteOptionsType;Defined in: classes/MoebiusPalettes.ts:32
Implementation of
MoebiusPaletteInterface.options
secondaryColor
secondaryColor: MoebiusColorInterface;Defined in: classes/MoebiusPalettes.ts:25
Implementation of
MoebiusPaletteInterface.secondaryColor
themes
themes: MoebiusThemeColorsInterface;Defined in: classes/MoebiusPalettes.ts:27
Implementation of
MoebiusPaletteInterface.themes
Methods
analogous()
analogous(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:286
Generate an analogous color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the analogous palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the analogous palette.
Example
const baseColor = '#3498db';
const analogousPalette = analogous(baseColor, { numberOfColors: 5 });
console.log(analogousPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#db3474']complement()
complement(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:102
Generate a complement color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the complement palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.<
Returns
`#${string}`[]
- Array of hex color values representing the complement palette.
Example
const baseColor = '#3498db';
const complementPalette = complement(baseColor, { numberOfColors: 5 });
console.log(complementPalette); // ['#3498db', '#db3434', '#75db34', '#dbd134', '#db7434']darkMode()
darkMode(
baseColor: MoebiusChromaColorInputType,
secondaryColor: MoebiusChromaColorInputType,
options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>
): Record<string, MoebiusColorValueHexType[]>;Defined in: classes/MoebiusPalettes.ts:129
Generates a dark mode color palette based on the provided base and secondary colors.
Parameters
baseColor
The base color for the palette.
secondaryColor
The secondary color for the palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Palette options.
Returns
Record<string, MoebiusColorValueHexType[]>
- The generated dark mode color palette.
Example
const baseColor = '#3498db';
const secondaryColor = '#2ecc71';
const options = { bezier: true, colorScaleMode: 'lch' };
const palette = darkMode(baseColor, secondaryColor, options);
console.log(palette);harmonize()
harmonize(
color: `#${string}`,
start: number,
end: number,
interval: number,
options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>
): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:405
Generate a harmonized color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the harmonized palette.
start
number
The starting angle for generating harmonized colors (degrees).
end
number
The ending angle for generating harmonized colors (degrees).
interval
number
The interval between harmonized colors (degrees).
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the harmonized palette.
Example
const baseColor = '#3498db';
const harmonizedPalette = harmonize(baseColor, 30, 210, 30, {
noDuplicates: true
});
console.log(harmonizedPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#3498db']hexadic()
hexadic(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:260
Generate a hexadic color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the hexadic palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the hexadic palette.
Example
const baseColor = '#3498db';
const hexadicPalette = hexadic(baseColor, { numberOfColors: 5 });
console.log(hexadicPalette); // ['#3498db', '#5d7f33', '#8473a9', '#ad7a95', '#db3434']interpolate()
interpolate(
primaryColor: `#${string}`,
secondaryColor: `#${string}`,
options?: MoebiusPaletteOptionsType
): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:315
Interpolate between two colors and generate a color palette.
Parameters
primaryColor
`#${string}`
The starting color for interpolation.
secondaryColor
`#${string}`
The ending color for interpolation.
options?
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the interpolated palette.
Example
const startColor = '#3498db';
const endColor = '#db3434';
const interpolatedPalette = interpolate(startColor, endColor, {
numberOfColors: 5
});
console.log(interpolatedPalette); // ['#3498db', '#5d6d7e', '#8473a9', '#ad7a95', '#db3434']luminanceShift()
luminanceShift(
colors: `#${string}`[],
divergingColors?: `#${string}`[],
options?: MoebiusPaletteOptionsType
): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:346
Generate a luminance shift palette based on an array of colors, with optional diverging colors.
Parameters
colors
`#${string}`[]
Array of base colors for generating the luminance shift palette.
divergingColors?
`#${string}`[] = []
Array of diverging colors.
options?
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the luminance shift palette.
Example
const baseColors = ['#3498db', '#99db34'];
const divergingColors = ['#db3434'];
const luminanceShiftPalette = luminanceShift(baseColors, divergingColors, {
numberOfColors: 5
});
console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']monochromatic()
monochromatic(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:379
Generates a monochromatic color palette based on the given color.
Parameters
color
`#${string}`
The base color for the palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- An array of hex color values in the palette.
Example
const baseColor = '#003f5c';
const options = { numberOfColors: 5, bezier: true, randomOffset: false };
const monochromaticPalette = monochromatic(baseColor, options);
console.log(monochromaticPalette);
[
'#003f5c', // maniacMansion,
'#014268', // darkImperialBlue,
'#024575', // macraggeBlue,
'#044784', // bridgeport,
'#064898', // frightNight,
'#0745b6', // absoluteZero,
'#002df5' // blueBouquet
];pentadic()
pentadic(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:234
Generate a pentadic color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the pentadic palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the pentadic palette.
Example
const baseColor = '#3498db';
const pentadicPalette = pentadic(baseColor, { numberOfColors: 5 });
console.log(pentadicPalette); // ['#3498db', '#dbd134', '#db3434', '#34db99', '#8f34db']split()
split(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:156
Generate a split color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the split palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the split palette.
Example
const baseColor = '#3498db';
const splitPalette = split(baseColor, { numberOfColors: 5 });
console.log(splitPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']tetradic()
tetradic(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:208
Generate a tetradic color palette based on the input color.
Parameters
color
`#${string}`
The base color for generating the tetradic palette.
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Options for generating the palette.
Returns
`#${string}`[]
- Array of hex color values representing the tetradic palette.
Example
const baseColor = '#3498db';
const tetradicPalette = tetradic(baseColor, { numberOfColors: 5 });
console.log(tetradicPalette); // ['#3498db', '#db3434', '#34db99', '#dbd134', '#8f34db']triadic()
triadic(color: `#${string}`, options?:
| MoebiusPaletteOptionsType
| Record<string, unknown>): `#${string}`[];Defined in: classes/MoebiusPalettes.ts:182
Generates a triadic color palette based on the input color.
Parameters
color
`#${string}`
The input color in various formats (HEX, RGB, HSL, etc.).
options?
| MoebiusPaletteOptionsType | Record<string, unknown> = {}
Additional options for palette generation.
Returns
`#${string}`[]
An array of HEX values representing the triadic color palette.
Example
const triadicPalette = triadic('#3498db', { numberOfColors: 5 });
console.log(triadicPalette);
// Output: ['#3498db', '#db344f', '#4fdb34', '#9834db', '#34db98']