Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / lipsum / image / PhabricatorLipsumMondrianArtist.php
blob41cce9de897885ae6aeb4fcbd4dbb717d502f701
1 <?php
3 final class PhabricatorLipsumMondrianArtist extends PhabricatorLipsumArtist {
5 protected function draw($image, $x, $y) {
6 $c_white = 0xFFFFFF;
7 $c_black = 0x000000;
8 imagefill($image, 0, 0, $c_white);
10 $lines_h = mt_rand(2, 5);
11 $lines_v = mt_rand(2, 5);
13 for ($ii = 0; $ii < $lines_h; $ii++) {
14 $yp = mt_rand(0, $y);
16 $thickness = mt_rand(2, 3);
17 for ($jj = 0; $jj < $thickness; $jj++) {
18 imageline($image, 0, $yp + $jj, $x, $yp + $jj, $c_black);
22 for ($ii = 0; $ii < $lines_v; $ii++) {
23 $xp = mt_rand(0, $x);
25 $thickness = mt_rand(2, 3);
26 for ($jj = 0; $jj < $thickness; $jj++) {
27 imageline($image, $xp + $jj, 0, $xp + $jj, $y, $c_black);
31 $fills = mt_rand(3, 8);
32 for ($ii = 0; $ii < $fills; $ii++) {
33 $xp = mt_rand(0, $x - 1);
34 $yp = mt_rand(0, $y - 1);
35 if (imagecolorat($image, $xp, $yp) != $c_white) {
36 continue;
39 $c_fill = $this->getHSBColor(
40 mt_rand(0, 359),
41 mt_rand(80, 100) / 100,
42 mt_rand(90, 100) / 100);
44 imagefill($image, $xp, $yp, $c_fill);