2
color: rgb(51, 51, 51);
, color: #333333
및 color: black; opacity: 0.8;
이 회색 음영을 생성한다는 것을 발견했습니다. 어떻게 일반화 할 수 있습니까?회색조 - 검정색 불투명도 변환
즉, 임의의 RGB 또는 HEX 색/회색 음영이 주어진 경우 의 해당 값을 어떻게 결정할 수 있습니까? color: black;
?
<style>
div {
font-family: sans-serif;
font-size: 48px;
margin: 20px;
padding: 60px;
}
.rgb {
color: rgb(51, 51, 51); /* given this value... */
}
.hex {
color: #333333; /* ...or given this value */
}
.opacity {
color: black;
opacity: 0.8; /* how can I determine this value? */
}
<style>
<body>
<div class="rgb">rgb(51, 51, 51)</div>
<div class="hex">hex #333333</div>
<div class="opacity">opacity 0.8</div>
</body>
이 https://www.viget.com/articles/에서보세요 값 동등한 색상 및 투명성 –