Skip to content

Instantly share code, notes, and snippets.

@NattyNarwhal
Created May 4, 2016 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NattyNarwhal/4584e3b0a3f4dd35aeb7978184041a38 to your computer and use it in GitHub Desktop.
Save NattyNarwhal/4584e3b0a3f4dd35aeb7978184041a38 to your computer and use it in GitHub Desktop.
for (int i = 2; i <= step; i++)
{
var rd = (c1.R > c2.R ? c1.R - c2.R : c2.R - c1.R) / i;
var gd = (c1.G > c2.G ? c1.G - c2.G : c2.G - c1.G) / i;
var bd = (c1.B > c2.B ? c1.B - c2.B : c2.B - c1.B) / i;
if (showDiff)
{
var nc = new RgbColor(rd, gd, bd);
bc.Add(nc);
}
else
{
var r = (c1.R > c2.R ? c1.R - rd : c2.R - rd);
var g = (c1.G > c2.G ? c1.G - gd : c2.G - gd);
var b = (c1.B > c2.B ? c1.B - bd : c2.B - bd);
var nc = new RgbColor(r, g, b);
bc.Add(nc);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment