Path: blob/master/src/applications/lipsum/image/PhabricatorLipsumMondrianArtist.php
12256 views
<?php12final class PhabricatorLipsumMondrianArtist extends PhabricatorLipsumArtist {34protected function draw($image, $x, $y) {5$c_white = 0xFFFFFF;6$c_black = 0x000000;7imagefill($image, 0, 0, $c_white);89$lines_h = mt_rand(2, 5);10$lines_v = mt_rand(2, 5);1112for ($ii = 0; $ii < $lines_h; $ii++) {13$yp = mt_rand(0, $y);1415$thickness = mt_rand(2, 3);16for ($jj = 0; $jj < $thickness; $jj++) {17imageline($image, 0, $yp + $jj, $x, $yp + $jj, $c_black);18}19}2021for ($ii = 0; $ii < $lines_v; $ii++) {22$xp = mt_rand(0, $x);2324$thickness = mt_rand(2, 3);25for ($jj = 0; $jj < $thickness; $jj++) {26imageline($image, $xp + $jj, 0, $xp + $jj, $y, $c_black);27}28}2930$fills = mt_rand(3, 8);31for ($ii = 0; $ii < $fills; $ii++) {32$xp = mt_rand(0, $x - 1);33$yp = mt_rand(0, $y - 1);34if (imagecolorat($image, $xp, $yp) != $c_white) {35continue;36}3738$c_fill = $this->getHSBColor(39mt_rand(0, 359),40mt_rand(80, 100) / 100,41mt_rand(90, 100) / 100);4243imagefill($image, $xp, $yp, $c_fill);44}45}4647}484950