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.
a little more detail on your applications
If you mean that you want to be able to read the text regardless of the background color, try this:
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.
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.
n8huntsman wrote: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?
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

When I am in my programming mind, I should really read what sub-forum I am in before responding. DOH!
n8huntsman wrote: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.
Awesome. Thanks for the help Sean.

