{"id":37372,"date":"2018-05-12T03:01:21","date_gmt":"2018-05-11T17:01:21","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=37372"},"modified":"2018-04-26T14:10:11","modified_gmt":"2018-04-26T04:10:11","slug":"css-repeating-radial-gradients-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/css-repeating-radial-gradients-primer-tutorial\/","title":{"rendered":"CSS Repeating Radial Gradients Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/radial_gradients.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"CSS Radial Gradients Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/radial_gradients.jpg\" title=\"CSS Radial Gradients Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">CSS Repeating Radial Gradients Primer Tutorial<\/p><\/div>\n<p>Way back when with <a title='HTML\/Javascript Canvas Rainbow Primer Tutorial' href='#html\/jcrpt'>HTML\/Javascript Canvas Rainbow Primer Tutorial<\/a> we talked about CSS <a target=_blank title='Linear gradients information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/linear-gradient'>linear gradients<\/a> and radial gradients in the one blog posting, but ever since then, it has so much more that linear gradients have been useful to us here at this blog.<\/p>\n<p>Today, though, we turn a bit of attention to radial gradients, specifically <a target=_blank title='Repeated radial gradients information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/repeating-radial-gradient'>repeated radial gradients<\/a>.<\/p>\n<p>We&#8217;ve got a simple web application to play around with them in terms of &#8230;<\/p>\n<ul>\n<li>ellipse versus circle<\/li>\n<li>coloured versus black and white<\/li>\n<li>extent keyword (closest-corner, closest-side, farthest-corner, farthest-side)<\/li>\n<\/ul>\n<p>Below is one example of the CSS &#8230;<\/p>\n<p><code><br \/>\n.circlefarthest-corner {<br \/>\n  background: repeating-radial-gradient(circle farthest-corner,<br \/>\n      red, black 5%, blue 5%, green 10%);<br \/>\n}<br \/>\n<\/code><\/p>\n<p>Feel free to play away at this <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/radial_gradients.html\" title=\"Click picture\">live run<\/a> that has this <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/radial_gradients.html_GETME\" title=\"radial_gradients.html\">radial_gradients.html<\/a> downloadable underlying HTML and CSS (and event logic Javascript that changes the HTML div element className property, to suit).<\/p>\n<hr>\n<p id='html\/jcrpt'>Previous relevant <a target=_blank title='HTML\/Javascript Canvas Rainbow Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-canvas-rainbow-primer-tutorial\/'>HTML\/Javascript Canvas Rainbow 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\/Canvas\/canvasrainbow.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Canvas Rainbow Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/canvasrainbow.jpg\" title=\"HTML\/Javascript Canvas Rainbow Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Canvas Rainbow Primer Tutorial<\/p><\/div>\n<p>The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.<\/p>\n<p>In today&#8217;s tutorial we touch on a couple of the two dimensional Javascript functions to draw a rectangle or arc, but in the two dimensional context, canvas HTML elements can be used to draw text, lines, boxes and circles as well.  We also touch on two functions to create a <a target=_blank title='HTML canvas linear gradient' href='http:\/\/www.w3schools.com\/tags\/canvas_createlineargradient.asp'>linear<\/a> or <a target=_blank title='HTML canvas radial gradient' href='http:\/\/www.w3schools.com\/tags\/canvas_createradialgradient.asp'>radial<\/a> gradient to the fillStyle and\/or strokeStyle of your HTML element placed onto the canvas.<\/p>\n<p>You may want to read more at <a target=_blank title='HTML Canvas Reference' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>HTML Canvas Reference<\/a> as a generic reference, or here, at the tutorial <a target=_blank title='javascript - How do I add a simple onClick event handler to a canvas element? - Stack Overflow' href='http:\/\/stackoverflow.com\/questions\/9880279\/how-do-i-add-a-simple-onclick-event-handler-to-a-canvas-element'>javascript &#8211; How do I add a simple onClick event handler to a canvas element? &#8211; Stack Overflow<\/a>.<\/p>\n<p>As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.<\/p>\n<p>Link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/canvasrainbow.html-GETME' title='canvasrainbow.html'>canvasrainbow.html<\/a>\n<\/p>\n<p>Here is a new link to some downloadable HTML programming source code explaining changes made (from <a target=_blank title='HTML\/Javascript Canvas Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5539'>HTML\/Javascript Canvas Primer Tutorial<\/a>)  <a target=_blank title='canvasrainbow.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/canvasrainbow.html-GETME\">here<\/a>.<\/p>\n<p>You&#8217;ll notice heavy use of the Javascript <a target=_blank title='Javascript Math.random() information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_random.asp'>Math.random()<\/a> function.<\/p>\n<p>We hope you enjoy this tutorial as a rainbow coloured <a target=_blank title='Canvas HTML element live run tutorial'  href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/canvasrainbow.html\">live run<\/a>.<\/p>\n<p>Yes &#8230; you&#8217;ve reached the end &#8230; have a top supportive rainbow coloured day!<\/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='#d5747' onclick='var dv=document.getElementById(\"d5747\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=59\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5747' 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='#d37372' onclick='var dv=document.getElementById(\"d37372\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/css\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d37372' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Way back when with HTML\/Javascript Canvas Rainbow Primer Tutorial we talked about CSS linear gradients and radial gradients in the one blog posting, but ever since then, it has so much more that linear gradients have been useful to us &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/css-repeating-radial-gradients-primer-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,37],"tags":[281,576,2020,997,2526,2527,1319],"class_list":["post-37372","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-css","tag-html","tag-linear-gradient","tag-programming","tag-radial-gradient","tag-repeated-radial-gradient","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37372"}],"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=37372"}],"version-history":[{"count":2,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37372\/revisions"}],"predecessor-version":[{"id":37374,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37372\/revisions\/37374"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=37372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=37372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=37372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}