Created
May 27, 2019 20:58
-
-
Save CyberShadow/dba71d202b341f680d119ac0aeefb01e to your computer and use it in GitHub Desktop.
Bad D deprecation demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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