2,6d1 < // SVG_Primer.php < // Draw SVG elemnts < // RJM Programming < // December, 2016 < // Features a colour picker ... perhaps via HTML(5) input type=color 92,106d86 < function arrdo() { < $arrb = "\n var arrb=['pink','#ffc0cb'"; < if (file_exists("ideasfrom.txt")) { < $vers=strtolower(file_get_contents("ideasfrom.txt")); < $codetds=explode("", $vers); < for ($ik=2; $ik<(-1 + sizeof($codetds)); $ik+=2) { < $names=explode("", str_replace("","",$codetds[0 + $ik])); < $r_g_b=explode(" ", str_replace("", "", str_replace("", "", str_replace("\n", "",$codetds[$ik])))); < $arrb .= "," . "'" . $names[-3 + sizeof($names)] . "','#" . substr(("0" . $r_g_b[0]), (strlen($r_g_b[0]) - 1)) . substr(("0" . $r_g_b[1]), (strlen($r_g_b[1]) - 1)) . substr(("0" . $r_g_b[2]), (strlen($r_g_b[2]) - 1)) . "'\n"; < } < } < $arrb .= "]; \n"; < return $arrb; < } < 179c159 < SVG Tutorial - RJM Programming - July, 2014 and December, 2016 ... thanks to http://www.tutorialspoint.com/html5/html5_svg.htm --- > SVG Tutorial - RJM Programming - July, 2014 ... thanks to http://www.tutorialspoint.com/html5/html5_svg.htm 184,213d163 < var arr=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']; < var colourpickerhelper=''; < var colourpickerhelperone=''; < var colourpickerhelpertwo=''; < < < < function modifyback(one_or_two) { < var r,g,b; < r = document.getElementById('s' + one_or_two + 'stop-colorr').value; < g = document.getElementById('s' + one_or_two + 'stop-colorg').value; < b = document.getElementById('s' + one_or_two + 'stop-colorb').value; < document.getElementById('s' + one_or_two + 'stop-color').value ='#' + arr[(r-(r % 16)) / 16] + arr[r % 16] + arr[(g-(g % 16)) / 16] + arr[g % 16] + arr[(b-(b % 16)) / 16] + arr[b % 16]; < } < < function modify(hexin, idprefix) { < var ival=0; < var inhex=hexin.toLowerCase().replace('#',''); < ival+=arr.indexOf(inhex.substring(1,2)); < ival+=(16 * arr.indexOf(inhex.substring(0,1))); < document.getElementById(idprefix + 'r').value=ival; < ival=0; < ival+=arr.indexOf(inhex.substring(3,4)); < ival+=(16 * arr.indexOf(inhex.substring(2,3))); < document.getElementById(idprefix + 'g').value=ival; < ival=0; < ival+=arr.indexOf(inhex.substring(5,6)); < ival+=(16 * arr.indexOf(inhex.substring(4,5))); < document.getElementById(idprefix + 'b').value=ival; < } 223c173 < odivcontents = odivcontents + "
Colour: " + colourpickerhelper + "
"; --- > odivcontents = odivcontents + "
Colour:
"; 227c177 < odivcontents = odivcontents + "
Colour: " + colourpickerhelper + "
"; --- > odivcontents = odivcontents + "
Colour:
"; 233c183 < odivcontents = odivcontents + "
Stroke Colour: " + colourpickerhelper + "
"; --- > odivcontents = odivcontents + "
Stroke Colour:
"; 240c190 < odivcontents = odivcontents + "
Colour: " + colourpickerhelper + "
"; --- > odivcontents = odivcontents + "
Colour:
"; 244c194 < odivcontents = odivcontents + "
Colour: " + colourpickerhelper + "
"; --- > odivcontents = odivcontents + "
Colour:
"; 248c198 < odivcontents = odivcontents + "
Colour: " + colourpickerhelper + "
"; --- > odivcontents = odivcontents + "
Colour:
"; 258,260c208,210 < odivcontents = odivcontents + 'Stop 1 Red 0->255: ' + colourpickerhelperone + '
'; < odivcontents = odivcontents + 'Stop 1 Green 0->255:
'; < odivcontents = odivcontents + 'Stop 1 Blue 0->255:
'; --- > odivcontents = odivcontents + 'Stop 1 Red 0->255:
'; > odivcontents = odivcontents + 'Stop 1 Green 0->255:
'; > odivcontents = odivcontents + 'Stop 1 Blue 0->255:
'; 263,265c213,215 < odivcontents = odivcontents + 'Stop 2 Red 0->255: ' + colourpickerhelpertwo + '
'; < odivcontents = odivcontents + 'Stop 2 Green 0->255:
'; < odivcontents = odivcontents + 'Stop 2 Blue 0->255:
'; --- > odivcontents = odivcontents + 'Stop 2 Red 0->255:
'; > odivcontents = odivcontents + 'Stop 2 Green 0->255:
'; > odivcontents = odivcontents + 'Stop 2 Blue 0->255:
';