Results 1 to 8 of 8

Thread: colored text with contrasting colored background

  1. #1
    Join Date
    Dec 2010
    Location
    Murrieta, Ca
    Posts
    554

    Default colored text with contrasting colored background

    What is the best way to accomplish this? I can't see to figure it out. I'd like colored text with a contrasting colored background.
    5 houses using:
    Renard 64, 3 Ren24's, Ren8
    4 E682 pixel controllers
    2,300 WS2801 pixel nodes
    1200 dumb RGB
    Sequenced using LSP 2.5

  2. #2
    Join Date
    Dec 2010
    Location
    Cape Coral, FL
    Posts
    1,041

    Default Re: colored text with contrasting colored background

    a little more detail on your applications
    Got 100 of These connected to 10 of These controlled by one of These! Let's FLASH!

  3. #3
    Join Date
    Dec 2009
    Location
    Gresham, OR (45.483992, -122.453879)
    Posts
    1,591

    Default Re: colored text with contrasting colored background

    If you mean that you want to be able to read the text regardless of the background color, try this:

    Code:
            public static Color getContrastingColor(Color color)
            {
                int yiq = ((color.R * 299) + (color.G * 587) + (color.B * 114)) / 1000;
    
                return yiq >= 128 ? Color.Black : Color.White;
            }
    based on YIQ

    This will always allow you to read text regardless of the background color. It is in my Utils class on just about any project dealing with color and text.

  4. #4
    Join Date
    Dec 2010
    Location
    Murrieta, Ca
    Posts
    554

    Default Re: colored text with contrasting colored background

    I mean, using Nutcracker text class, I'd like to have a green background and have red text scroll across. I thought there was a way to do it without code or layers but I guess not.
    Last edited by n8huntsman; 08-29-2012 at 11:43 PM.
    5 houses using:
    Renard 64, 3 Ren24's, Ren8
    4 E682 pixel controllers
    2,300 WS2801 pixel nodes
    1200 dumb RGB
    Sequenced using LSP 2.5

  5. #5
    Join Date
    Dec 2011
    Location
    Littleton, Colorado
    Posts
    871

    Default Re: colored text with contrasting colored background

    Quote Originally Posted by n8huntsman View Post
    I mean, using Nutcracker text class, I'd like to have a green background and have red text scroll across. I thought there was a way to do it without code or layers but I guess not.
    create an effect with the color_wash class. Set start and end color to green
    create a text effect with text in red, set duration the same as color_wash above

    now use the layer effect
    1) color_wash
    2) text

    and choose that effect 2 takes priority over 1.
    i created GREEN_BACKGROUND and MERRY_CHRISTMAS effects in your account.
    here is result of layer

    Effect Settings
    username n8huntsman
    user_target 5.125_32_STRINGS
    effect_class layer
    effect_name RED_TEXT_ON_GREEN
    layer_method Pri-2
    file1 5.125_32_STRINGS+GREEN_BACKGROUND.nc
    file2 5.125_32_STRINGS+MERRY_CHRISTMAS.nc
    LAYER_EFFECTS Array
    lmethod Pri-2
    frame_delay 100
    seq_duration 10
    fade_in 0
    fade_out 0
    submit Submit Form to create your effect
    OBJECT_NAME layer


    RED on GREEN is one of these contrasts that can be hard on the eyes. Maybe darken the green background more?
    Last edited by smeighan; 08-30-2012 at 09:56 AM.
    Sean
    Highlands Ranch, CO
    Nutcracker RGB Sequence Builder http://nutcracker123.com/nutcracker
    Build your own 9' Nutcracker http://meighan.net/build_your_own_nutcrackers

  6. #6
    Join Date
    Dec 2011
    Location
    Littleton, Colorado
    Posts
    871

    Default Re: colored text with contrasting colored background

    i did one more pass.
    darkened green in color_wash and added 20% sparkles (what the heck?)


    Effect Settings
    username n8huntsman
    user_target 5.125_32_STRINGS
    effect_class layer
    effect_name RED_TEXT_ON_GREEN2
    layer_method Pri-2
    file1 5.125_32_STRINGS+GREEN_BACKGROUND_SPARKLE.nc
    file2 5.125_32_STRINGS+MERRY_CHRISTMAS.nc
    LAYER_EFFECTS Array
    lmethod Pri-2
    frame_delay 100
    seq_duration 10
    fade_in 0
    fade_out 0
    submit Submit Form to create your effect
    OBJECT_NAME layer
    Sean
    Highlands Ranch, CO
    Nutcracker RGB Sequence Builder http://nutcracker123.com/nutcracker
    Build your own 9' Nutcracker http://meighan.net/build_your_own_nutcrackers

  7. #7
    Join Date
    Dec 2009
    Location
    Gresham, OR (45.483992, -122.453879)
    Posts
    1,591

    Default Re: colored text with contrasting colored background

    When I am in my programming mind, I should really read what sub-forum I am in before responding. DOH!

    Quote Originally Posted by n8huntsman View Post
    I mean, using Nutcracker text class, I'd like to have a green background and have red text scroll across. I thought there was a way to do it without code or layers but I guess not.

  8. #8
    Join Date
    Dec 2010
    Location
    Murrieta, Ca
    Posts
    554

    Default Re: colored text with contrasting colored background

    Awesome. Thanks for the help Sean.
    5 houses using:
    Renard 64, 3 Ren24's, Ren8
    4 E682 pixel controllers
    2,300 WS2801 pixel nodes
    1200 dumb RGB
    Sequenced using LSP 2.5

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •