js+css实现在线调色板工具代码

代码语言:html

所属分类:其他

代码描述:js+css实现在线调色板工具代码,通过基础色来调节亮度、色调、换位等效果代码,最终生成的色可复制下载。

代码标签: js css 在线 调色板 工具 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
<style>
@import url(https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Poppins&display=swap);

:root {
	/* VARIABLES FOR COLOR-CALCULATION */
	--base-hue: 240;
	--saturation: 85%;
	--lightness: 60%;
	/* steps in degree on the color-wheel 
	to the next hue-value */
	--rotation: 40;

	/* APPEARANCE */
	--main: hsl(var(--base-hue), var(--saturation), var(--lightness));
	--shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.base-color {
	/* COLOR CALCULATION */
	--hue: var(--base-hue);
	/* generate the color with the given 
	value of --hue */
	background-color: hsl(var(--hue), var(--saturation), var(--lightness));

	/* APPEARANCE */
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 135px;
	width: 10vw;
	min-height: 75px;
	height: 4vw;
	box-shadow: var(--shadow);
}
.base-color:hover {
	transform: scale(1.1);
}
/* INDIVIDUAL --hue-VALUES 
by applying multiples of --rotation */
.color2 {
	--hue: calc(var(--base-hue) + var(--rotation) * 2);
}
.color3 {
	--hue: calc(var(--base-hue) + var(--rotation) * 3);
}
.color4 {
	--hue: calc(var(--base-hue) + var(--rotation) * 4);
}
.color5 {
	--hue: calc(var(--base-hu.........完整代码请登录后点击上方下载按钮下载查看

网友评论0