mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-06-18 14:11:22 +00:00
remove "spotify" as color selection algorithm
This commit is contained in:
parent
ca0d24fd11
commit
e50b8b4bb3
1 changed files with 7 additions and 14 deletions
|
|
@ -368,11 +368,11 @@ Dribbblish.on("ready", () => {
|
||||||
key: "aboutDribbblishInfo",
|
key: "aboutDribbblishInfo",
|
||||||
name: "Info",
|
name: "Info",
|
||||||
description: `
|
description: `
|
||||||
OS: \`${capitalizeFirstLetter(Spicetify.Platform.PlatformData.os_name)} v${Spicetify.Platform.PlatformData.os_version}\`
|
OS: \`${capitalizeFirstLetter(Spicetify.Platform.PlatformData.os_name)} v${Spicetify.Platform.PlatformData.os_version}\`
|
||||||
Spotify: \`v${Spicetify.Platform.PlatformData.event_sender_context_information?.client_version_string ?? Spicetify.Platform.PlatformData.client_version_triple}\`
|
Spotify: \`v${Spicetify.Platform.PlatformData.event_sender_context_information?.client_version_string ?? Spicetify.Platform.PlatformData.client_version_triple}\`
|
||||||
Spicetify: \`${Spicetify.version != null ? `v${Spicetify.version}` : "< v2.7.3"}\`
|
Spicetify: \`${Spicetify.version != null ? `v${Spicetify.version}` : "< v2.7.3"}\`
|
||||||
Dribbblish: \`v${process.env.DRIBBBLISH_VERSION}-${process.env.COMMIT_HASH}\`
|
Dribbblish: \`v${process.env.DRIBBBLISH_VERSION}-${process.env.COMMIT_HASH}\`
|
||||||
`,
|
`,
|
||||||
data: "Copy",
|
data: "Copy",
|
||||||
onChange: function () {
|
onChange: function () {
|
||||||
copyToClipboard(this.description.replace(/\`/g, ""));
|
copyToClipboard(this.description.replace(/\`/g, ""));
|
||||||
|
|
@ -550,11 +550,10 @@ Dribbblish.on("ready", () => {
|
||||||
Algorithm of selecting colors from the albumart
|
Algorithm of selecting colors from the albumart
|
||||||
- **Colorthief [(see)](https://lokeshdhakar.com/projects/color-thief/):** Gets more fitting colors
|
- **Colorthief [(see)](https://lokeshdhakar.com/projects/color-thief/):** Gets more fitting colors
|
||||||
- **Vibrant [(see)](https://jariz.github.io/vibrant.js/):** Gets more vibrant colors *(was the default up to v3.1.1)*
|
- **Vibrant [(see)](https://jariz.github.io/vibrant.js/):** Gets more vibrant colors *(was the default up to v3.1.1)*
|
||||||
- **Spotify:** Basically Vibrant but internal and without support of local files
|
|
||||||
- **Static:** Select a static color to be used
|
- **Static:** Select a static color to be used
|
||||||
{.muted}
|
{.muted}
|
||||||
`,
|
`,
|
||||||
data: { spotify: "Spotify", colorthief: "Colorthief", vibrant: "Vibrant", static: "Static" },
|
data: { colorthief: "Colorthief", vibrant: "Vibrant", static: "Static" },
|
||||||
defaultValue: "colorthief",
|
defaultValue: "colorthief",
|
||||||
onChange: () => updateColors(),
|
onChange: () => updateColors(),
|
||||||
showChildren: (val) => {
|
showChildren: (val) => {
|
||||||
|
|
@ -791,13 +790,7 @@ Dribbblish.on("ready", () => {
|
||||||
const colorSelectionMode = Dribbblish.config.get("colorSelectionMode");
|
const colorSelectionMode = Dribbblish.config.get("colorSelectionMode");
|
||||||
let palette = {};
|
let palette = {};
|
||||||
|
|
||||||
if (colorSelectionAlgorithm == "spotify") {
|
if (colorSelectionAlgorithm == "colorthief") {
|
||||||
const swatches = await Spicetify.colorExtractor(Spicetify.Player.data.track.uri);
|
|
||||||
for (const col of ["VIBRANT", "VIBRANT_NON_ALARMING", "PROMINENT", "DARK_VIBRANT", "LIGHT_VIBRANT", "DESATURATED"]) {
|
|
||||||
const c = chroma(swatches[col]);
|
|
||||||
palette[c.luminance()] = c;
|
|
||||||
}
|
|
||||||
} else if (colorSelectionAlgorithm == "colorthief") {
|
|
||||||
palette = Object.fromEntries([colorThief.getColor(img), ...colorThief.getPalette(img, 24, 5)].map((c) => chroma(c)).map((c) => [c.luminance(), c]));
|
palette = Object.fromEntries([colorThief.getColor(img), ...colorThief.getPalette(img, 24, 5)].map((c) => chroma(c)).map((c) => [c.luminance(), c]));
|
||||||
} else if (colorSelectionAlgorithm == "vibrant") {
|
} else if (colorSelectionAlgorithm == "vibrant") {
|
||||||
const swatches = await new Promise((resolve, reject) => new Vibrant(img, 5).getPalette().then(resolve).catch(reject));
|
const swatches = await new Promise((resolve, reject) => new Vibrant(img, 5).getPalette().then(resolve).catch(reject));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue