Skip to content

Commit

Permalink
remove unused util
Browse files Browse the repository at this point in the history
  • Loading branch information
jriyyya committed Nov 23, 2024
1 parent 3e2e642 commit c000679
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion packages/client/src/pages/discover/TokenCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import FlexSeparator from "../../shared/components/FlexSeparator.tsx";
import Icon from "../../shared/components/Icon.tsx";
import { formatAddress } from "../../shared/lib/utils.ts";

export default function TokenCard() {
return (
Expand Down
18 changes: 0 additions & 18 deletions packages/client/src/shared/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,3 @@ export function formatAddress(address: string) {
address.slice(address.length - 5, address.length)
);
}

export function getImageDominantRgb(
src: string,
): Promise<Uint8ClampedArray> {
return new Promise((resolve) => {
const context = document.createElement("canvas").getContext("2d");
context!.imageSmoothingEnabled = true;

let img = new Image();
img.src = src;
img.crossOrigin = "";

img.onload = () => {
context!.drawImage(img, 0, 0, 1, 1);
resolve(context!.getImageData(0, 0, 1, 1).data.slice(0, 3));
};
});
}

0 comments on commit c000679

Please sign in to comment.