Skip to content

Instantly share code, notes, and snippets.

@kanzwataru
Created June 17, 2022 12:58
Show Gist options
  • Select an option

  • Save kanzwataru/759e2d2a62dd61e3d03c28e093dc053f to your computer and use it in GitHub Desktop.

Select an option

Save kanzwataru/759e2d2a62dd61e3d03c28e093dc053f to your computer and use it in GitHub Desktop.
# Based on https://krita-artists.org/t/checkerbord-seexpr-pattern/13900
$color1 = [0,0,0];
$color2 = [1,1,1];
$scale_horizontal = 3 ; # 1,500
$scale_vertical = 3; # 1,500
$offset_horizontal = 5; # 1,500
$offset_vertical = 5; # 1,500
$rotation = 0; # 0,360
$rotated = rotate([$u, $v, 0], [0, 0, 1], rad($rotation));
$u = $rotated[0];
$v = $rotated[1];
$x = floor(($u * ($scale_horizontal)) % 2);
$y = floor(($v * ($scale_vertical)) % 2);
if (($x || $y) && !($x && $y)) {
$color = $color1;
}
else {
$color = $color2;
}
$color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment