+
@@ -33,11 +166,96 @@
display: flex;
}
.hsv {
+ position: relative;
min-height: 9em;
width: 100%;
- border: 1px solid red;
+ overflow: hidden;
+ user-select: none;
}
- .hue {
+ .hsv_hue {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+ .hsv_saturation {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-image:
+ linear-gradient(to right,
+ rgba(255, 255, 255, 255) 0%,
+ rgba(255, 255, 255, 0) 100%)
+ ;
+ }
+ .hsv_value {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-image:
+ linear-gradient(to bottom,
+ transparent 0%,
+ rgb(0, 0, 0) 100%)
+ ;
+ }
+ .hsv_cursor {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+ }
+ .hsv_cursor-left {
+ position: absolute;
+ left: -100%;
+ top: -2px;
+ margin-left: -1px;
+ width: 100%;
+ height: 3px;
+ background: black;
+ border: 1px solid rgba(255,255,255,0.5);
+ border-right: 0;
+ border-left: 0;
+ }
+ .hsv_cursor-right {
+ position: absolute;
+ left: 0;
+ top: -2px;
+ width: 100%;
+ height: 3px;
+ background: black;
+ border: 1px solid rgba(255,255,255,0.5);
+ border-right: 0;
+ border-left: 0;
+ }
+ .hsv_cursor-bottom {
+ position: absolute;
+ left: -2px;
+ top: 0;
+ width: 3px;
+ height: 100%;
+ background: black;
+ border: 1px solid rgba(255,255,255,0.5);
+ border-bottom: 0;
+ border-top: 0;
+ }
+ .hsv_cursor-top {
+ position: absolute;
+ left: -2px;
+ top: -100%;
+ margin-top: -1px;
+ width: 3px;
+ height: 100%;
+ background: black;
+ border: 1px solid rgba(255,255,255,0.5);
+ border-bottom: 0;
+ border-top: 0;
+ }
+ .hue {
background-image: linear-gradient(to left,
#ff0000, #ff0080,
#ff00ff, #8000ff,
@@ -49,10 +267,6 @@
);
}
.alpha {
- background-image: linear-gradient(to right,
- transparent 0%,
- rgba(255, 0, 0, 1) 100%
- );
z-index: 0;
}
.checkerboard {
@@ -68,4 +282,21 @@
background-size: 10px 10px;
background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}
+ .slider {
+ position: relative;
+ user-select: none;
+ overflow: hidden;
+ }
+ .cursor {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 4px;
+ height: 100%;
+ border: 1px solid black;
+ border-top: 0;
+ border-bottom: 0;
+ margin-left: -2px;
+ z-index: 1;
+ }
\ No newline at end of file
diff --git a/frontend/src/sections/Palette.svelte b/frontend/src/sections/Palette.svelte
index 7911af2..843a34b 100644
--- a/frontend/src/sections/Palette.svelte
+++ b/frontend/src/sections/Palette.svelte
@@ -1,19 +1,50 @@