我试图做一个颜色选择器, 其中的颜色是从标准的内置系统调色板中选择的。是否可以在输入类型中调用预设的颜色调色板而不是标准调色板?
是否可以制作我自己选择的有限颜色集,然后将其用作输入颜色方法中的调色板?
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<!-- CLICK TO CHANGE COLOR -->
<input type="color" value="#e73d18">
<!-- Image Credit -->
</body>
</html>
的style.css:
body {
background-image: url(http://gecko.sashaz.com/green_Gecko.jpg)no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
margin: 0;
}
input {
/* removes default styling from input color element */
padding: 0;
border: none;
/* makes input (color swatch) 100% size of container */
position: absolute;
width: 100%;
height: 100%;
/* mix blend mode makes the color of the swatch alter the image behind it. */
mix-blend-mode: hue;
cursor: pointer;
}
/* removes default styling from input color element */
::-webkit-color-swatch {
border: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-moz-color-swatch,
::-moz-focus-inner {
border: none;
}
::-moz-focus-inner {
padding: 0;
}
/* Image Credit */
a {
position: absolute;
bottom: 10px;
right: 10px;
color: skyblue;
background: black;
display: block;
padding: 3px 8px;
font-size: 18px;
text-decoration: none;
}
_“是有可能使有限的颜色集我自己选择的,然后用它作为输入法的颜色调色板?” _不能肯定正确解释的要求?预期的结果是什么?限制颜色选择选项? – guest271314
是的,确切地说,如何限制他们到我的选择? –