Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Main area of interest, this function will
- /// return color for each particular color on our [ui.Image]
- int generatePixel(int x, int y, Size size) {
- var tiles = 5.0;
- var uv = Vector2(x / size.width, y / size.height);
- uv.y /= size.aspectRatio;
- var gridUv = frac2(uv * tiles);
- /// We have a square with top left and bottom right quarters
- /// painter with white and the rest being black.
- return (gridUv.x < .5 && gridUv.y < .5) || (gridUv.x > .5 && gridUv.y > .5)
- ? 0xffffffff
- : 0xff000000;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement