Create Tertiary Colors with blendMode = "add" ?

I can create red and green circles and where they overlap I get yellow when blendMode on the objects are set to add. That works for any primary color – I get the correct secondary color.

But when I overlap a primary and a secondary color I should get a tertiary color and I get nothing – the circles don’t blend.

Is there something broken or do I just not understand how this is supposed to work? :slight_smile:

 Jay

local r = display.newCircle(160, 50, 50)
r:setFillColor(1,0,0)

local g = display.newCircle(120, 100, 50)
g:setFillColor(0,1,0)
g.blendMode=“add”

local b = display.newCircle(200, 100, 50)
b:setFillColor(0,0,1)

b.blendMode=“add”

produced:

rgbvenn.jpg

So it seems to be working for me

i think he’s talking about (for example) mixing red (an RGB primary) and yellow (an RGB secondary) and expecting orange (a supposed RGB tertiary) like in first-grade art class.

which, unfortunately, is not possible by additive blending emissive colors against black.  that type of “real world” color blending, like mixing pigmented paint on white paper, is actually subtractive in these terms.

for example, red paint absorbs all other wavelengths leaving only red to reflect.  if you mix it with yellow paint, absorbing some of those red wavelengths as well, then what remains of white light to be reflected will appear as orange.

on the other hand, red pixels emit, so emissive red plus emissive yellow still = yellow.  there’s no way to add yellow to red in emissive RGB to produce orange.  (you’d need to subtract some RGB green from RGB yellow to get RGB orange)

fwiw hth

Dave needs to teach a Corona class. Or maybe I should just enroll in whatever classes he teaches at CalTech.

Yeah, what Dave said – blending primary colors works fine, just not blending secondary colors. So when I see orange on the screen it’s not a blend of red + yellow, it’s a blend of red + (yellow - some green)?

So is there a way to subtract green from the yellow? If I decrease the alpha of the green before blending with red it allows me to get an orange but would that be the “correct” way to handle this?

I’m playing around with a color-mixing app for art appreciation class. They said I could use any medium, so I choose digital. :slight_smile:

 Jay

if for a class, and free to choose “what” is demonstrated, then suggestion: label it instead as a “stage light simulator”.  stage lights with colored gels against a dark stage will sum toward white in a manner very similar to additive rgb (primary difference that real photons don’t clip at 255 :D)

local r = display.newCircle(160, 50, 50)
r:setFillColor(1,0,0)

local g = display.newCircle(120, 100, 50)
g:setFillColor(0,1,0)
g.blendMode=“add”

local b = display.newCircle(200, 100, 50)
b:setFillColor(0,0,1)

b.blendMode=“add”

produced:

rgbvenn.jpg

So it seems to be working for me

i think he’s talking about (for example) mixing red (an RGB primary) and yellow (an RGB secondary) and expecting orange (a supposed RGB tertiary) like in first-grade art class.

which, unfortunately, is not possible by additive blending emissive colors against black.  that type of “real world” color blending, like mixing pigmented paint on white paper, is actually subtractive in these terms.

for example, red paint absorbs all other wavelengths leaving only red to reflect.  if you mix it with yellow paint, absorbing some of those red wavelengths as well, then what remains of white light to be reflected will appear as orange.

on the other hand, red pixels emit, so emissive red plus emissive yellow still = yellow.  there’s no way to add yellow to red in emissive RGB to produce orange.  (you’d need to subtract some RGB green from RGB yellow to get RGB orange)

fwiw hth

Dave needs to teach a Corona class. Or maybe I should just enroll in whatever classes he teaches at CalTech.

Yeah, what Dave said – blending primary colors works fine, just not blending secondary colors. So when I see orange on the screen it’s not a blend of red + yellow, it’s a blend of red + (yellow - some green)?

So is there a way to subtract green from the yellow? If I decrease the alpha of the green before blending with red it allows me to get an orange but would that be the “correct” way to handle this?

I’m playing around with a color-mixing app for art appreciation class. They said I could use any medium, so I choose digital. :slight_smile:

 Jay

if for a class, and free to choose “what” is demonstrated, then suggestion: label it instead as a “stage light simulator”.  stage lights with colored gels against a dark stage will sum toward white in a manner very similar to additive rgb (primary difference that real photons don’t clip at 255 :D)