|
|

楼主 |
发表于 2024-5-28 13:01
|
显示全部楼层
hsl,h = hue,色相(0~360);s = saturation,饱和度(0%~100%),l = lightness,亮度(0%~100%)。正常颜色的饱和度为 100%,亮度为 50%。下面代码展示色轮上6种代表性颜色与角度的关系:
- <style>
- .mama {
- margin: 15px auto;
- width: 400px;
- height: 400px;
- position: absolute;
- }
- .son {
- position: absolute;
- left: calc(50% - 30px);
- top: 40px;
- width: 60px;
- height: 160px;
- border-radius: 10% 90%;
- border: 1px solid gray;
- transform-origin: 50% 100%;
- writing-mode: vertical-rl;
- text-orientation: upright;
- color: black;
- display: grid;
- place-items: center;
- background: var(--bg);
- }
- .son:nth-of-type(1) { --bg: hsl(60,100%,50%); transform: rotate(60deg) translateY(-15px); }
- .son:nth-of-type(2) { --bg: hsl(120,100%,50%); transform: rotate(120deg) translateY(-15px); }
- .son:nth-of-type(3) { --bg: hsl(180,100%,50%); transform: rotate(180deg) translateY(-15px); }
- .son:nth-of-type(4) { --bg: hsl(240,100%,50%); transform: rotate(240deg) translateY(-15px); color: silver; }
- .son:nth-of-type(5) { --bg: hsl(300,100%,50%); transform: rotate(300deg) translateY(-15px); }
- .son:nth-of-type(6) { --bg: hsl(360,100%,50%); transform: rotate(360deg) translateY(-15px); }
- </style>
- <div class="mama">
- <div class="son">黄 60</div>
- <div class="son">绿 120</div>
- <div class="son">青 180</div>
- <div class="son">蓝 240</div>
- <div class="son">品红 300</div>
- <div class="son">红 360</div>
- </div>
复制代码
|
评分
-
| 参与人数 2 | 威望 +80 |
金钱 +160 |
经验 +80 |
收起
理由
|
南无月
| + 30 |
+ 60 |
+ 30 |
很给力! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|