Home
Options

yield?

How do I create an enumerable list? Currently I have
public static IEnumerable< Color > Ramp(Color f, Color t, int n)
{
. . .
for(var i = 0; i < n; i++)
{
yield new Color(f.R - (i * ri),
f.G - (i * gi),
f.B - (i * bi));
}
}

But the keyword 'yield' is in red, indicating that the keyword is undefined.
Ideas?
Thank you.

Comments

Sign In or Register to comment.