Skip to content

Commit

Permalink
Update lanyard.js
Browse files Browse the repository at this point in the history
  • Loading branch information
j0ell1 authored Oct 13, 2024
1 parent 1594f60 commit a1cbcd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lanyard.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function connectToLanyard() {
albumArtElement.onload = function () {
const colorThief = new ColorThief();
const dominantColor = colorThief.getColor(albumArtElement);
const palette = colorThief.getPalette(albumArtElement, 4);
const palette = colorThief.getPalette(albumArtElement, 3);

const gradient = `linear-gradient(135deg, rgb(${dominantColor[0]}, ${dominantColor[1]}, ${dominantColor[2]}, ${dominantColor[3]}, ${dominantColor[4]}), rgb(${palette[1][0]}, ${palette[1][1]}, ${palette[1][2]}, ${palette[1][3]}, ${palette[1][4]}))`;
const gradient = `linear-gradient(135deg, rgb(${dominantColor[0]}, ${dominantColor[1]}, ${dominantColor[2]}, ${dominantColor[3]}), rgb(${palette[1][0]}, ${palette[1][1]}, ${palette[1][2]}, ${palette[1][3]},))`;
document.body.style.background = gradient; // Set the new gradient background
};
} else {
Expand Down

0 comments on commit a1cbcd2

Please sign in to comment.