diff --git a/src/component/colorPicker/index.less b/src/component/colorPicker/index.less index ea9aa51f..97ff790c 100644 --- a/src/component/colorPicker/index.less +++ b/src/component/colorPicker/index.less @@ -1,7 +1,7 @@ .layui-color-picker { position: relative; user-select: none; - width: 100%; + width: 320px; background: #fff; padding: 10px; } @@ -75,8 +75,7 @@ position: relative; height: 10px; box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); - background: #fff - url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAWElEQVRIiWM8fubkfwYygKWJOSM5+mCAhRLNoxaPWjxq8ajFoxbTyeL/DAfJ0Xjs3Cl7Siwmu4Yht1aDgZEYx6MWj1o8avGoxaMWD3qLya5X//4nqx6HAQC7RBGFzolqTAAAAABJRU5ErkJggg=="); + background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAWElEQVRIiWM8fubkfwYygKWJOSM5+mCAhRLNoxaPWjxq8ajFoxbTyeL/DAfJ0Xjs3Cl7Siwmu4Yht1aDgZEYx6MWj1o8avGoxaMWD3qLya5X//4nqx6HAQC7RBGFzolqTAAAAABJRU5ErkJggg=="); background-size: 10px 10px; } @@ -102,6 +101,14 @@ background-size: 10px 10px; } +.layui-colorpicker > span { + width: 26px; + height: 26px; + display: block; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAWElEQVRIiWM8fubkfwYygKWJOSM5+mCAhRLNoxaPWjxq8ajFoxbTyeL/DAfJ0Xjs3Cl7Siwmu4Yht1aDgZEYx6MWj1o8avGoxaMWD3qLya5X//4nqx6HAQC7RBGFzolqTAAAAABJRU5ErkJggg=="); + background-size: 10px 10px; +} + /* 颜色的值 hex rgba */ .color-value { width: 100%; @@ -124,7 +131,7 @@ outline: none; text-align: center; border-radius: 2px; - border: 1px solid #ccc; + border: 1px solid #eee; } .color-value p { @@ -160,8 +167,9 @@ .preset li { width: 20px; height: 20px; + padding: 0px; margin-right: 6px; margin-bottom: 6px; - border: 1px solid #ccc; + border: 1px solid #eee; border-radius: 2px; } diff --git a/src/component/colorPicker/index.vue b/src/component/colorPicker/index.vue index fea1173e..a7a8e734 100644 --- a/src/component/colorPicker/index.vue +++ b/src/component/colorPicker/index.vue @@ -1,79 +1,93 @@ - - - - - - - - - - - - - - + + + - - - - - + + + + + + + class="saturation-value" + ref="saturationValue" + @mousedown="mousedownSV" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - Hex - - - - - - R - - - - - - G - - - - - - B - - - - - - A - - - - - - + +
Hex
R
G
B
A