@instadapp/avocado-base 0.0.58 → 0.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,21 @@
1
1
  <script setup lang="ts">
2
+ import * as XXH from 'xxhashjs';
3
+
2
4
  defineProps<{
3
5
  address: string
4
6
  }>();
5
7
 
6
8
  const randomId = Math.random().toString(36).substr(2, 9);
9
+
10
+ export function generateColor(address: string): string {
11
+ const hash = XXH.h32(address, 0xABCD).toNumber()
12
+
13
+ const hue = hash % 360
14
+ const saturation = 80 + (hash % 30)
15
+ const lightness = 70 + (hash % 20)
16
+
17
+ return `hsl(${hue}, ${saturation}%, ${lightness}%)`
18
+ }
7
19
  </script>
8
20
 
9
21
  <template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
package/utils/helper.ts CHANGED
@@ -1,5 +1,3 @@
1
- import * as XXH from 'xxhashjs';
2
-
3
1
  export const indexSorter = (aIndex: number, bIndex: number) => {
4
2
  if (aIndex === -1 && bIndex === -1) {
5
3
  return 0; // fallback to other sorting criteria
@@ -62,12 +60,3 @@ export function formatMultipleAddresses(addresses: string[], shorten = true) {
62
60
  return formattedString
63
61
  }
64
62
 
65
- export function generateColor(address: string): string {
66
- const hash = XXH.h32(address, 0xABCD).toNumber()
67
-
68
- const hue = hash % 360
69
- const saturation = 80 + (hash % 30)
70
- const lightness = 70 + (hash % 20)
71
-
72
- return `hsl(${hue}, ${saturation}%, ${lightness}%)`
73
- }