digimezzo / dopamine

The audio player that keeps it simple
https://digimezzo.github.io/site/
GNU General Public License v3.0
1.4k stars 108 forks source link

[Enhancement] Dynamic Colors #551

Open DavidRLTG opened 6 months ago

DavidRLTG commented 6 months ago

image

Image attached, An example of how it could look via the Beats theme and a fitting song.

I think it would be really cool if the app colors changed depending on the album cover of the song playing. Makes it more immersive, I guess.

digimezzo commented 6 months ago

@DavidRLTG That's a great idea! I'm adding this as a feature request. Oh by the way, I see in your screenshot that the scroll bars are blue, despite setting the Beats theme. That's a know issue. I made a small mistake in the last preview. This will be fixed in the next preview.

DavidRLTG commented 6 months ago

Thanks fella :) And aye, good luck with fixing the issue!!

saxophone-guy commented 5 months ago

+1

saxophone-guy commented 5 months ago

I might make a PR. A possible way to do this is to use node-vibrant. An example:

const Vibrant = require('node-vibrant');

async function getAccentColor(imagePath) {
  try {
    const palette = await Vibrant.from(imagePath).getPalette();

    const accentColor = palette.Vibrant.getHex();

    return accentColor;
  } catch (error) {
    console.error('Error extracting accent color:', error.message);
    return null;
  }
}

// Example usage:
const imagePath = 'path/to/your/image.jpg';

getAccentColor(imagePath)
  .then((accentColor) => {
    if (accentColor) {
      console.log('Accent Color:', accentColor);
    } else {
      console.log('Unable to extract accent color.');
    }
  })
  .catch((error) => {
    console.error('Error:', error);
  });
digimezzo commented 5 months ago

@TheBeeBoi Sounds great! I'm not working on this feature yet, so feel free to create a PR. I'll gladly review it.