Skip to main content

colorExtractor

Extracts colors from a playlist, track, album, artist, show, etc.

function colorExtractor(uri: string): Promise<{
DESATURATED: string;
LIGHT_VIBRANT: string;
PROMINENT: string;
VIBRANT: string;
VIBRANT_NON_ALARMING: string;
}>;

Parameters

ParameterTypeDescription
uristringURI of anything that has artwork (playlist, track, album, artist, show, etc.)

Returns

NameTypeDescription
DARK_VIBRANTstringDark vibrant color in hex format.
DESATURATEDstringDesaturated color in hex format.
LIGHT_VIBRANTstringLight vibrant color in hex format.
PROMINENTstringProminent color in hex format.
VIBRANTstringVibrant color in hex format.
VIBRANT_NON_ALARMINGstringVibrant non alarming color in hex format.

Example

// Get color from current track
const currentTrack = Spicetify.Player.data.item;
const colors = await Spicetify.colorExtractor(currentTrack.uri);