{"id":26698,"date":"2016-12-02T03:01:53","date_gmt":"2016-12-01T17:01:53","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=26698"},"modified":"2016-12-01T20:02:35","modified_gmt":"2016-12-01T10:02:35","slug":"phpjavascript-svg-colour-picker-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-svg-colour-picker-tutorial\/","title":{"rendered":"PHP\/Javascript SVG Colour Picker Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/\"><img decoding=\"async\" id=\"hjspt\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP\/Javascript SVG Colour Picker Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/colour_picker_input.jpg\" title=\"PHP\/Javascript SVG Colour Picker Tutorial\"  onmouseover=\" document.getElementById('hjspt').src = document.getElementById('hjspt').src.replace('png','PNG').replace('jpg','png').replace('PNG','jpg');     \" \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript SVG Colour Picker Tutorial<\/p><\/div>\n<p>Today&#8217;s posting hooks up two <a target=_blank title='HTML5 information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/HTML5'>HTML5<\/a> concepts, as described below &#8230;<\/p>\n<ul>\n<li>The HTML5 specification allows for the display of 2D-graphics via <a target=_blank href='http:\/\/www.tutorialspoint.com\/html5\/html5_svg.htm' title='SVG information'>SVG HTML tags<\/a> which use graphical applications in XML and the XML is then rendered by a SVG viewer.  SVG stands for Scalable Vector Graphics.<\/li>\n<li>The HTML5 specification added <a target=_blank title='HTML input information from w3schools' href='http:\/\/www.w3schools.com\/html\/html_form_input_types.asp'>some new very useful<\/a> HTML input element types, and today, we&#8217;re talking about the <a target=_blank title='HTML5 input type=color information from w3schools' href='http:\/\/www.w3schools.com\/html\/tryit.asp?filename=tryhtml_input_color'><i>type=color<\/i><\/a> element type that brings up a pretty suave colour picker helper, in some browsers<\/li>\n<\/ul>\n<p>There are alternative colour pickers out there, in addition to what HTML5 has given us, and you may want to read <a target=_blank title='YUI UI Colour Picker Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/yui-ui-colour-picker-primer-tutorial\/'>YUI UI Colour Picker Primer Tutorial<\/a> about that.<\/p>\n<p>Today, we&#8217;ll leave you with <a target=_blank title='SVG_Primer.php' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/SVG_Primer.php--GETME'>SVG_Primer.php<\/a> changed from <a target=_blank title='PHP GD and Image Functions Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-gd-and-image-functions-primer-tutorial\/'>PHP GD and Image Functions Primer Tutorial<\/a>&#8216;s version in <a target=_blank title='SVG_Primer.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/SVG_Primer.php--GETME'>this way<\/a>.  And before you leave, you could create your own SVG elements via this <a target=_blank title='SVG_Primer.php' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/SVG_Primer.php'>live run<\/a> link.<\/p>\n<hr>\n<p id='pjspt'>Previous relevant <a target=_blank title='PHP\/Javascript SVG Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-svg-primer-tutorial\/'>PHP\/Javascript SVG Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/\"><img decoding=\"async\" id=\"hjspt\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP\/Javascript SVG Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/SVG_Primer.png\" title=\"PHP\/Javascript SVG Primer Tutorial\"  onmouseover=\" document.getElementById('hjspt').src = document.getElementById('hjspt').src.replace('png','PNG').replace('jpg','png').replace('PNG','jpg');     \" \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript SVG Primer Tutorial<\/p><\/div>\n<p>The HTML5 specification allows for the display of 2D-graphics via <a target=_blank href='http:\/\/www.tutorialspoint.com\/html5\/html5_svg.htm' title='SVG information'>SVG HTML tags<\/a> which use graphical applications in XML and the XML is then rendered by an SVG viewer.   SVG stands for Scalable Vector Graphics.<\/p>\n<p>We&#8217;ve talked about the HTML canvas element as another means to come to this end, but the SVG methods are more straightforward in their creation.<\/p>\n<p>For today&#8217;s tutorial we follow the advice at this wonderful <a target=_blank href='http:\/\/www.tutorialspoint.com\/html5\/html5_svg.htm' title='SVG information'>tutorial<\/a> and wrap it in PHP, so that you can specify your own parameters.   Hope you find it very useful, and easy.<\/p>\n<p>This demonstrates to you that if you have some great static HTML you can keep that great static content and present a dynamic version the user can play around with, and learn from, by adding that PHP server-side content.   For today&#8217;s PHP interface we got the HTML to use an HTML form of the relevant shape&#8217;s characteristics and <i>post<\/i> this data back to the same PHP webpage, analyzing the $_POST[] data to fill in the static HTML parameter values with user-defined parameter alternatives.<\/p>\n<p>Today we have PHP and Javascript programmable source code you could call <a target=_blank title='SVG_Primer.php' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/SVG_Primer.php_GETME'>SVG_Primer.php<\/a> and here is its <a target=_blank title='SVG_Primer.php' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SVG\/SVG_Primer.php'>live run<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#8614' onclick='var dv=document.getElementById(\"d8614\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=HTML5\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d8614' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#26698' onclick='var dv=document.getElementById(\"d26698\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=svg\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d26698' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s posting hooks up two HTML5 concepts, as described below &#8230; The HTML5 specification allows for the display of 2D-graphics via SVG HTML tags which use graphical applications in XML and the XML is then rendered by a SVG viewer. &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-svg-colour-picker-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[224,228,576,578,609,652,932,997,1226,1319],"class_list":["post-26698","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-colour","tag-colour-picker","tag-html","tag-html5","tag-input","tag-javascript","tag-php","tag-programming","tag-svg","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/26698"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=26698"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/26698\/revisions"}],"predecessor-version":[{"id":26701,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/26698\/revisions\/26701"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=26698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=26698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=26698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}