問題:
Say I have a background color with a "ribbon" running over it in another solid color.假設我有一個背景顏色,上面有一條“絲帶”,上面有另一種純色。 Now, I want the ribbon to be partially transparent to let some details blend through, but still keep the ribbon the "same color" over the background.現在,我希望色帶部分透明,讓一些細節混合通過,但仍然讓色帶在背景上保持“相同的顏色”。
Is there a way to (easily) determine, for a given opacity/alpha < 100% of the ribbon color, what RGB values it should have to be identical to its color with 100% opacity over the background?有沒有辦法(輕鬆)確定,對於給定的不透明度/alpha < 100% 色帶顏色,它應該具有哪些 RGB 值與其背景上的 100% 不透明度的顏色相同?
Here's a picture.這是一張圖片。 Background is rgb(72, 28, 97)
, ribbon rgb(45, 34, 70)
.背景是rgb(72, 28, 97)
,色帶rgb(45, 34, 70)
。 I want a rgba(r, g, b, a)
for the ribbon so that it appears identical to this solid color.我想要一個rgba(r, g, b, a)
作爲色帶,以便它看起來與這種純色相同。