Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created May 27, 2019 20:58
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 CyberShadow/dba71d202b341f680d119ac0aeefb01e to your computer and use it in GitHub Desktop.
Save CyberShadow/dba71d202b341f680d119ac0aeefb01e to your computer and use it in GitHub Desktop.
Bad D deprecation demo
import ae.sys.file;
import ae.utils.graphics.color;
import ae.utils.graphics.draw;
import ae.utils.graphics.image;
enum red = RGB(0xFF, 0, 0);
enum green = RGB(0, 0xFF, 0);
enum blue = RGB(0, 0, 0xFF);
void main()
{
auto img = Image!RGB(200, 100);
foreach (int i, color; [red, green, blue])
img.fillCircle(50 + i * 20, 30 + i * 10, 20 + i * 5, color);
img.toPNG.toFile("circles.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment