How about rendering a SVG server-side and using that for the PictureFillSymbol.
Here is an example of PHP code that draws 2 adjacent rectangles with randomized colours:
<?php
Header('Content-type: image/svg+xml; charset=utf-8');
$r1 = rand(0,255);
$g1 = rand(0,255);
$b1 = rand(0,255);
$r2 = rand(0,255);
$g2 = rand(0,255);
$b2 = rand(0,255);
echo '<!DOCTYPE html>';
echo '<svg id="vectors1" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet" version="1.1" xmlns="http://www.w3.org/2000/svg">';
echo '<rect id="data1" x="0" y="0" width="20" height="20" style="fill:rgb('.$r1.','.$g1.','.$b1.');stroke-width:0;stroke:rgb(0,0,0)" />';
echo '<rect id="data2" x="20" y="0" width="20" height="20" style="fill:rgb('.$r2.','.$g2.','.$b2.');stroke-width:0;stroke:rgb(0,0,0)" />';
echo '</svg>';
?>