Skip to content

Commit 6e573e7

Browse files
KrupaPanchal2527crutchcorn
authored andcommitted
feat: display hex codes for extracted colors
1 parent d6d6a2d commit 6e573e7

2 files changed

Lines changed: 41 additions & 6 deletions

File tree

website/src/page-components/index/VibrantColors.module.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,21 @@
1717
flex-grow: 1;
1818
border-radius: 12px;
1919
padding: 14px 20px;
20+
cursor: pointer;
21+
transition: transform 200ms ease-out;
22+
}
23+
24+
.swatch:hover {
25+
transform: scale(1.05);
26+
}
27+
28+
.swatch > div {
29+
all: unset;
30+
}
31+
32+
.swatch-hex {
33+
all: unset;
34+
font-size: 0.8rem;
35+
text-transform: uppercase;
36+
opacity: 0.8;
2037
}

website/src/page-components/index/VibrantColors.tsx

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ const VibrantColors = ({ img }: VibrantColorsProps) => {
4848
} as React.CSSProperties
4949
}
5050
>
51-
Vibrant
51+
<div>
52+
<p>Vibrant</p>
53+
<p className={styles["swatch-hex"]}>{colors.Vibrant?.hex}</p>
54+
</div>
5255
</li>
5356
<li
5457
className={styles.swatch}
@@ -59,7 +62,10 @@ const VibrantColors = ({ img }: VibrantColorsProps) => {
5962
} as React.CSSProperties
6063
}
6164
>
62-
Dark Vibrant
65+
<div>
66+
<p>Dark Vibrant</p>
67+
<p className={styles["swatch-hex"]}>{colors.DarkVibrant?.hex}</p>
68+
</div>
6369
</li>
6470
<li
6571
className={styles.swatch}
@@ -70,7 +76,10 @@ const VibrantColors = ({ img }: VibrantColorsProps) => {
7076
} as React.CSSProperties
7177
}
7278
>
73-
Light Vibrant
79+
<div>
80+
<p>Light Vibrant</p>
81+
<p className={styles["swatch-hex"]}>{colors.LightVibrant?.hex}</p>
82+
</div>
7483
</li>
7584
<li
7685
className={styles.swatch}
@@ -81,7 +90,10 @@ const VibrantColors = ({ img }: VibrantColorsProps) => {
8190
} as React.CSSProperties
8291
}
8392
>
84-
Muted
93+
<div>
94+
<p>Muted</p>
95+
<p className={styles["swatch-hex"]}>{colors.Muted?.hex}</p>
96+
</div>
8597
</li>
8698
<li
8799
className={styles.swatch}
@@ -92,7 +104,10 @@ const VibrantColors = ({ img }: VibrantColorsProps) => {
92104
} as React.CSSProperties
93105
}
94106
>
95-
Dark Muted
107+
<div>
108+
<p>Dark Muted</p>
109+
<p className={styles["swatch-hex"]}>{colors.DarkMuted?.hex}</p>
110+
</div>
96111
</li>
97112
<li
98113
className={styles.swatch}
@@ -103,7 +118,10 @@ const VibrantColors = ({ img }: VibrantColorsProps) => {
103118
} as React.CSSProperties
104119
}
105120
>
106-
Light Muted
121+
<div>
122+
<p>Light Muted</p>
123+
<p className={styles["swatch-hex"]}>{colors.LightMuted?.hex}</p>
124+
</div>
107125
</li>
108126
</ul>
109127
);

0 commit comments

Comments
 (0)