Color mixing

tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
I've been working on a game that involves sliding single color bars across each other to create blended colors (e.g. yellow+blue=green). Ideally, I'd like bright, strong primary colors but I'm finding that I have to set self.color.alpha to 0.5 (50%) to get the colors to look blended at all.

Unfortunately, in addition to the less than ideal look of the semi-transparent images, I have to contend with the fact that the colors look different based on the layering. So blue over yellow is not the same as yellow over blue:

image

I think I can fix that by using a layer changing method (duplicate actors on a "front" and "back" layer that swap with each other) but I'm looking for general suggestions about how to improve the color blending.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Best Answers

  • gyroscopegyroscope I am here.Posts: 6,598
    edited April 2013 Accepted Answer

    Hi @tatiang A couple of observations which might or might not help you:

    • I changed the blue to cyan, and with the yellow set to Multiply, not Additive, I get green where they overlap.

    • if the background is white, you see both colours, but when the colour (in this case, yellow) is set to Multiply and is on black, it disappears, so obviously it'll need a white box in the back of it to show it.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SocksSocks London, UK.Posts: 12,822
    edited April 2013 Accepted Answer
    @tatiang

    You are going to have to decide on process colours, C,M,Y (with K being made from a mix of all three) or 'transmitted' (RGB) colours . . . . if you want them to work on any background of your choice you will need to give each actor a substrate of some kind (white for CMYK / black for RGB) and set them on the correct transfer mode (multiply for CMYK / screen for RGB).

    If you don't use a substrate actor then your background will need to be white for a CMYK system or black for a RGB system.

    Here's quick example:

    http://www.mediafire.com/?z5oj33ei8nobjb8

    Top row CMYK / bottom row RGB.

    [caution, this was thrown together pretty quickly and uses the same move rules for all the actors (laziness on my part) so once you've placed them over each other don't click on the mixed area otherwise you will pick up all the actors at once !!]

Answers

  • DenimSharkDenimShark Member Posts: 192
    Have you played around with the blending modes on each actor?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I sure have. They mostly just make the intersecting rectangle black or white.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Thanks, @gyroscope, I'll play with those settings a bit. I'm trying to achieve combinations of yellow+blue, yellow+red, and blue+red on the same color background.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    Thanks, @Socks. I've already built the whole game with drag to move and constrains but I hadn't gotten the color mixing to work. That demo is helpful although I'm still not sure about it since the mixing is unconventional (red+green=yellow?; blue+red=pink?). I assume those are the correct colors for light but I'm thinking along the lines of mixing paint.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2013
    That demo is helpful although I'm still not sure about it since the mixing is unconventional (red+green=yellow?; blue+red=pink?)
    They are entirely conventional ! :) In an additive color model red and green will give you yellow . . . . and blue and red will give you magenta (rather than 'pink'). As you stack all three colours you should get pure white.

    This is how your TV, computer monitor, Photoshop and GameSalad (etc etc) work.

    Read this (if you have time): http://en.wikipedia.org/wiki/RGB_color_model

    image

    You might be confusing this with a reflected (rather than transmitted) colour model, for instance if you were to paint on paper then blue and red would give you a purple - if that is what you are after then playing around with CMYK will probably be a better route.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yes, I'm wanting paint on paper: blue+red=purple. Okay, thanks for the lead on using CMYK.

    I'm slightly color blind so your (and everyone else's) magenta is my 'pink' :P

    That's why I couldn't play this fabulous looking game: https://forums.gamesalad.com/discussion/41363/ink-blend-puzzle-game-ink-blend-master-release

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    The issue for me is that I want to present a color on screen and have the player create the color by sliding primary color bars. If I show yellow, I want them to leave the yellow slider unblended rather than thinking "okay, I need to drag red and green together to get yellow." Especially for kids, asking them to create orange from red and yellow makes more sense. But I also have a fallback plan to just use individual squares to make up the rectangles and change the colors "manually" via rules that say if red and yellow collide, change to orange. The problem there is that then if a slider is offset, the whole square will be one color rather than half of each color it overlaps (as i the original picture I posted).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2013
    @tatiang


    Here's a quick red + blue = purple mix:

    http://www.mediafire.com/?c9lp8zwz48i6su4
  • SocksSocks London, UK.Member Posts: 12,822
    I'm slightly color blind so your (and everyone else's) magenta is my 'pink' :P
    Magenta is kinda' half red, half blue (in transmitted light), whereas pink is technically just red + white in reflected light (although most people push it slightly towards blue as red + white gives you a salmon colour unless it's very pale) . . . . oh, god, this is getting far too esoteric, I'm going to make a cup of coffee.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    image

    That works pretty nicely for yellow, too... yay! Thanks for all your help!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I just tried to post a comment in GS Creator...

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    image

    That works pretty nicely for yellow, too... yay! Thanks for all your help!
    Don't forget to clean up after yourself and get the help of an adult if you are using scissors.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Don't forget to clean up after yourself and get the help of an adult if you are using scissors.
    My three-year-old is pretty good with scissors so I never have to do cutting work myself.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    My three-year-old is pretty good with scissors so I never have to do cutting work myself.
    :)

    I've got a 50% genetic share in a 5 year old (just 5 last month), if you ever want to stage a series of illegal underground toddler races for cash PM me, I want in.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Go back to making coffee, @Socks. My three-year-old is too fast!!!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2013
    Go back to making coffee, @Socks. My three-year-old is too fast!!!

    Who said the coffee is for me ?
Sign In or Register to comment.