If someone knows the "weights" of red, green, and blue, they can create a color using a class like
.customRGB {
color: rgb(128, 128, 128)
}
.customHSL {
color: hsl(33%, 34%, 33%)
and use it in HTML like this:
<p class="customRGB">CUSTOM RGB</p>
<p class="customHSL">CUSTOM HSL</p>
With the given values, customRGB
appears as dingy gray and customHSL
appears white.
But what if someone wants to represent combinations of other colors, such as green, blue, orange, and gold?
Is there a way to define such colors with a notation like the following?
.ColorMix {
color: truecolors(24, 13, 11, 12)
}
Or with color: gbog(24, 13, 11, 12)
where the letters in gbog
represent green, blue, orange, and gold respectively?
The goal would be that with the CSS definition above, the HTML
<p class="ColorMix">These are your True Colors, shining through!</p>
would display the text in a weighted combination of those four colors.
I believe this is achievable by utilizing some complex math involving the RGB values of green, blue, orange, and gold, but I am unsure of how to proceed with that.
UPDATE
I realize that a crucial aspect of the question, which I initially left out, would be, "What do you mean exactly by green, blue, orange, and gold?"
To clarify, based on information from the official "True Colors" website, and ColorZilla browser add-on, the RGB values for these colors are:
green = 15, 167, 73
blue = 0, 152, 215
orange = 243, 123, 38
gold = 255, 230, 101
(Though to me, they appear more like forest green, dodger blue, red-orange, and yellow.)