{"id":1092,"date":"2020-09-02T19:05:07","date_gmt":"2020-09-02T18:05:07","guid":{"rendered":"https:\/\/csee.bangor.ac.uk\/?p=1092"},"modified":"2020-09-02T19:05:07","modified_gmt":"2020-09-02T18:05:07","slug":"create-a-coloured-grid-in-processing","status":"publish","type":"post","link":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/","title":{"rendered":"Create a coloured grid in Processing"},"content":{"rendered":"\n<!-- Custom post code :: Pure CSS Rainbows -->\n<!-- Adds prettyprint for code snippets -->\n\n  code { background-color: rgba(0,0,0,.05); }\n  .linenums { color: #aaa; }\n  .linenums li {\n    list-style-type: decimal !important;\n    font-size: 12pt;\n    margin-top: 0px;\n  }\n  .linenums li:nth-child(even) { background: transparent !important; }\n  .wp-block-image { text-align: center !important; }\n  .wp-block-image img { display: inline; }\n\n\n\n\n\n<p>In this coding activity we will use the Processing library to create a grid of coloured squares. We will use the Hue Saturation Brightness (HSB) colour model to assign the colours, which I covered in a previous activity. Consequently, this activity follows from previous ones and I suggest you achieve those activities first:<\/p>\n\n\n\n<ol><li><a rel=\"noreferrer noopener\" href=\"https:\/\/csee.bangor.ac.uk\/project-rainbow\/introduction-to-processing\/\" target=\"_blank\">Setting up the programming environment<\/a>,&nbsp;<\/li><li>The activity to&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/csee.bangor.ac.uk\/project-rainbow\/using-the-critical-thinking-sheet\/\" target=\"_blank\">make a quick sketch before you code<\/a>, and&nbsp;<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/csee.bangor.ac.uk\/project-rainbow\/learn-hue-saturation-and-brightness-hsb-colour-coding\/\" target=\"_blank\">Hue Saturation Brightness<\/a>&nbsp;activities first.<\/li><li><a href=\"https:\/\/csee.bangor.ac.uk\/project-rainbow\/create-a-spectrum-of-coloured-squares\/\">Create a spectrum of coloured squares in Processing (part 1)<\/a><\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"334\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regular-grid-rainbow.png\" alt=\"Regular grid, coloured in a spectrum of colours, with a black stroke around each cell.\" class=\"wp-image-1116\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regular-grid-rainbow.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regular-grid-rainbow-300x141.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption>Regular grid, coloured in a spectrum of colours, with a black stroke around each cell.<\/figcaption><\/figure>\n\n\n\n<p><span class=\"has-inline-color has-accent-color\">At the end of this activity, <\/span>I want you to realise that (in coding) it is best to separate the index (position) of each grid cell and its actual x,y plotted position. This makes code that can be easily applied to different situations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1. Plan the picture<\/h2>\n\n\n\n<p>Whatever project you are doing, it is good to know where you are heading! The Critical Thinking Sheet can help you think and plan your code. <\/p>\n\n\n\n<p><span class=\"has-inline-color has-accent-color\"><strong>Our activity today <\/strong>is to create a picture of a grid of coloured shapes, where each square is placed alongside the other. <\/span><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regular-grid-random-colours.png\" alt=\"Coloured grid of random colours\" class=\"wp-image-1117\" width=\"425\" height=\"199\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regular-grid-random-colours.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regular-grid-random-colours-300x141.png 300w\" sizes=\"(max-width: 425px) 100vw, 425px\" \/><figcaption>Small regular grid of random coloured squares.<\/figcaption><\/figure><\/div>\n\n\n\n<p>We can think about this idea as a grid of cells, where each cell is the same size, sits next to another cell, and each cell includes one object. We could place different shapes in each cell (such as a rectangle or a circle), but let&#8217;s start by placing coloured squares. We could also change the colours of the circles to create various patterns, but let&#8217;s start simple and shade them by random colours. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/critical-thinking-sheet-sketched-regular.png\" alt=\"Critical Thinking Sheet, with the numbers in the panels.\" class=\"wp-image-1100\" width=\"273\" height=\"376\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/critical-thinking-sheet-sketched-regular.png 631w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/critical-thinking-sheet-sketched-regular-217x300.png 217w\" sizes=\"(max-width: 273px) 100vw, 273px\" \/><\/figure><\/div>\n\n\n\n<ol><li>If you have not done so already: print out the <a href=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/06\/CTS-Bangor-v1-2.pdf\">Critical Thinking Sheet<\/a>. On the printout, now complete the problem, name and add today&#8217;s date. Also explain the challenge part \u2460&nbsp;<\/li><li>In panel \u2461 make a sketch of the problem output, and annotate the diagram. <\/li><li>In panel \u2462 you can explain the main components of the system. In this challenge there are three main aspects: (i) the shape that we will plot, (ii) the colour that it will be, and (iii) the position we will place it in. <\/li><li>In panel \u2463 we can now explain the process (algorithm). A simple process is to run through every cell position (we can do this by going through all x positions and then all y positions), then set the required colour, and finally plot the shape.<\/li><li>Finally, we need to consider what to do next. Definitely we need to think more about the cell, and how to index each part, and about the colour model.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"1024\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regularGridSketch-sml-740x1024.jpeg\" alt=\"\" class=\"wp-image-1120\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regularGridSketch-sml-740x1024.jpeg 740w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regularGridSketch-sml-217x300.jpeg 217w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regularGridSketch-sml-768x1063.jpeg 768w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regularGridSketch-sml-1109x1536.jpeg 1109w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/regularGridSketch-sml.jpeg 1253w\" sizes=\"(max-width: 740px) 100vw, 740px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2. Set up the basic window<\/h2>\n\n\n\n<p>Setting up the Processing environment with basic code should easy now. <\/p>\n\n\n\n<ul><li>Set the window <code>size<\/code> to 600 by 200<\/li><li>Set <code>background<\/code> to white<\/li><li>Choose the <code>colorMode<\/code> to be HSB, and set all values (for now) to be 100<\/li><li>Plot a grey rectangle, to make sure it all works fine.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"912\" height=\"334\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/screenshot-40rects-testpict-grey.png\" alt=\"\" class=\"wp-image-1142\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/screenshot-40rects-testpict-grey.png 912w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/screenshot-40rects-testpict-grey-300x110.png 300w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/screenshot-40rects-testpict-grey-768x281.png 768w\" sizes=\"(max-width: 912px) 100vw, 912px\" \/><figcaption>Test picture, make sure that the Processing environment has been setup correctly. Showing one rectangle at 10,10, width and height being 100, and grey colour, with a white stroke,<\/figcaption><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted prettyprint linenums\"><code>size(800,200);<\/code>\n<code>colorMode(HSB, 100, 100, 100);<\/code>\n<code>background(100);<\/code>\n\/<code>\/ Do a test with one rectangle<\/code>\n<code>\/\/ just to make sure that everything is working<\/code> <code>fine <\/code>\n\n<code>fill(50);<\/code>\n<code>stroke(100);<\/code>\n<code>strokeWeight(2);<\/code>\n<code>rect(10,10,100,100);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3. Understand the grid and coordinate system<\/h2>\n\n\n\n<p><span class=\"has-inline-color has-accent-color\">Let us remind ourselves about the coordinate system in Processing.<\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text has-media-on-the-right is-stacked-on-mobile\" style=\"grid-template-columns:auto 37%\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"116\" height=\"95\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/rectangle-plotted.png\" alt=\"Rectangle plotted at (10,6)\" class=\"wp-image-1122\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>We can plot a rectangle in Processing, by describing the location of the top left position of the rectangle, and set its width and height. <\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-pullquote alignright has-background has-subtle-background-background-color is-style-solid-color\"><blockquote class=\"has-text-color has-primary-color\"><p><span class=\"has-inline-color has-accent-color\">Top Tip.<\/span><br>A unit square sets each side to be 1.<\/p><\/blockquote><\/figure>\n\n\n\n<p>Let us assume (for now) that the width and height of the rectangle is one.  This provides a really nice way to index every grid point. The first square is placed at (0,0), and then moving to the right we get the second at (1,0), third at (2,0) and so on. We are using the unit square, to simplify the code.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"366\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/cartesian-grid2.png\" alt=\"Unit grid, with first at (0,0), second (1,0), third (2,0) and so on\" class=\"wp-image-1126\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/cartesian-grid2.png 791w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/cartesian-grid2-300x139.png 300w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/cartesian-grid2-768x355.png 768w\" sizes=\"(max-width: 791px) 100vw, 791px\" \/><figcaption>Plotting lots of unit squares, we can plot the first at (0,0) then (1,0) and so on.<\/figcaption><\/figure>\n\n\n\n<p>This indexing scheme fits really well with a <strong>for<\/strong> loop. For example we can use two <strong>for<\/strong> loops to index positions in a 2D grid between 0 and 9 as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code prettyprint linenums\"><code>for(int x=0; x&lt;10; x++)\n   for(int y=0; y&lt;10; y++){\n   \/\/ loop code goes here\n}<\/code><\/pre>\n\n\n\n<p>But, if we directly plot 1 by 1 rectangles &#8211; they would be very small. Indeed, so small that they are only revealed when we zoom into the screenshot.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/processing-plotting-2-pixels.png\" alt=\"Two small 1-sided rectangles, plotted in Processing, one at (0,0) and the other at (1,1)\" class=\"wp-image-1104\" width=\"378\" height=\"278\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/processing-plotting-2-pixels.png 455w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/08\/processing-plotting-2-pixels-300x221.png 300w\" sizes=\"(max-width: 378px) 100vw, 378px\" \/><figcaption>Two small 1-sided rectangles, plotted in Processing, one at (0,0) and the other at (1,1)<\/figcaption><\/figure><\/div>\n\n\n\n<p>We need to scale everything up. In computer graphics scaling is performed through multiplication. So to scale everything by 10, we can multiple the index position <strong>x<\/strong> and <strong>y<\/strong> by 10 to get the real location, and multiple the unit rectangle by 10, to create a rectangle of 10 width by 10 height. Perhaps we want a grid of 12 rectangles by 12 rectangles, we just change the end conditions of both for-loop to 12. As follows:<\/p>\n\n\n\n<pre class=\"wp-block-code prettyprint linenums\"><code>for(int x=0; x&lt;12; x++)\n   for(int y=0; y&lt;12; y++){\n   rect( x * 10, y * 10, 10, 10);\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-pullquote alignright has-background has-subtle-background-background-color is-style-solid-color\"><blockquote class=\"has-text-color has-primary-color\"><p><span class=\"has-inline-color has-accent-color\">Top Tip.<\/span><\/p><p>Separate the quantity of items, and how they are indexed, from their use.<\/p><\/blockquote><\/figure>\n\n\n\n<p><span class=\"has-inline-color has-accent-color\"><strong>This is a really good strategy<\/strong>: separate the quantity of the things, and how they are indexed, from their use (or in our case, their position).<\/span><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"312\" height=\"334\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-grey.png\" alt=\"Regular grid, 12 by 12 grid of rectangles, all coloured grey, with white stroke.\" class=\"wp-image-1190\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-grey.png 312w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-grey-280x300.png 280w\" sizes=\"(max-width: 312px) 100vw, 312px\" \/><figcaption>Regular grid, 12 by 12 grid of rectangles, all coloured grey, with white stroke.<\/figcaption><\/figure><\/div>\n\n\n\n<p><strong>Refactor the code.<\/strong><\/p>\n\n\n\n<p>Let us improve the code making it more descriptive, and remove magic numbers. To do this we need to define some variables. <\/p>\n\n\n\n<ul><li>We can set <code>myScale<\/code> to be 10, <\/li><li>the <code>width<\/code> and <code>height<\/code> of each rectangle to be <code>cellSize<\/code>, <\/li><li>the size of the index could be different in X and the Y direction, so let&#8217;s define <code>gridQuantity<\/code>X and gridQuantityY also to 10. The code to achieve this result is as follows:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code prettyprint linenums\"><code>size(200,200);\ncolorMode(HSB, 100, 100, 100);\nbackground(100);\n\nfill(50);\nstroke(100);\nstrokeWeight(1);\n\nfloat myScale = 10;\nfloat cellSize  = 10;\nint gridQuantityX = 12;\nint gridQuantityY = 12;\n\nfor(int x=0; x&lt;gridQuantityX; x++)\n   for(int y=0; y&lt;gridQuantityY; y++){\n   rect( x * myScale, y * myScale, cellSize, cellSize);\n}<\/code><\/pre>\n\n\n\n<p><strong>Some observations with this code:<\/strong><\/p>\n\n\n\n<ul><li>if <code>cellSize<\/code> is bigger than <code>myScale<\/code> then the rectangles overlap, <\/li><li>if <code>cellSize<\/code> is smaller then <code>myScale<\/code> there is a small gap between each rectangle. <\/li><li>if  the result of <code>gridQuantityX*cellSize<\/code> is larger than the width or <code>gridQuantityY*cellSize<\/code> greater than the width of the window then not all the rectangles would be seen on that window.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5. Colour the squares and make the grid fill the window<\/h2>\n\n\n\n<p>Let&#8217;s change the code (slightly) to make the grid fill the window.  We can do this by setting the rectangle dimensions, and calculating the quantity of rectangles that will fit in the window. We also need to re-organise the code order to make it work; especially set the <code>colorMode<\/code> later, when we know the colour range.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote alignright has-background has-subtle-background-background-color is-style-solid-color\"><blockquote class=\"has-text-color has-primary-color\"><p>Top Tip.<\/p><p>Remember to refactor your code. <\/p><\/blockquote><\/figure>\n\n\n\n<ul><li>set the <code>cellSize<\/code> to <code>20<\/code><\/li><li>Calculate the (integer) quantity of cells that will fit in the window width, by <code>floor(width\/cellSize);<\/code><\/li><li>Calculate the (integer) quantity of cells that will fit in the window height, by <code>floor(height\/cellSize);<\/code> <\/li><li>Set the scale to the <code>cellSize<\/code>.<\/li><li>Set the colourRange in the HSB space to the <code>x<\/code> value of the gridQuantity;<\/li><li>Fill the colour based on the <code>x<\/code> value.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code prettyprint linenums\"><code>size(600,200);\nbackground(255);\n\nfloat cellSize    = 10;\nint gridQuantityX = floor(width\/cellSize);\nint gridQuantityY = floor(height\/cellSize);\n\nfloat myScale = cellSize;\nint colourRange = gridQuantityX;\n\ncolorMode(HSB, colourRange, 100, 100);\nstroke(0); \/\/ make it black\nstrokeWeight(2);\n\nfor(int x=0; x&lt;gridQuantityX; x++)\n   for(int y=0; y&lt;gridQuantityY; y++){\n     fill(x,100,100);\n      rect( x * myScale, y * myScale, cellSize, cellSize);\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"334\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-CellSize10.png\" alt=\"Rainbow of colours, in a window 600 by 200, and cellSize to 10\" class=\"wp-image-1194\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-CellSize10.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-CellSize10-300x141.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption>Rainbow of colours, in a window 600 by 200, and cellSize to 10<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6. Now your turn. Add variation and try different values<\/h2>\n\n\n\n<p><span class=\"has-inline-color has-accent-color\">Now we can change the basic code, to make it more interesting. <\/span><\/p>\n\n\n\n<p><strong>Try different colour combinations<\/strong>. Perhaps make them all one colour, random colours, or a small range of colours (such as light blue to dark blue.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote has-background has-subtle-background-background-color is-style-solid-color\"><blockquote class=\"has-text-color has-primary-color\"><p><span class=\"has-inline-color has-accent-color\">Top Tip.<\/span><\/p><p>Don&#8217;t guess values for your code. Instead <strong>imagine the end result, then choose values to achieve that result!<\/strong><\/p><\/blockquote><\/figure>\n\n\n\n<p><strong>Adapt the size of the rectangles<\/strong>. Try to make them bigger or smaller. Even make them really small, so that individually the rectangles cannot be seen.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"534\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-big-rectangles.png\" alt=\"Regular grid of very large rectangles\" class=\"wp-image-1201\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-big-rectangles.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-big-rectangles-300x225.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption>Regular grid of very large rectangles<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"534\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-small-rectangles.png\" alt=\"Regular grid of very small rectangles.\" class=\"wp-image-1202\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-small-rectangles.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-small-rectangles-300x225.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption>Regular grid of very small rectangles.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p><strong>Change the stroke and appearance of each rectangle.<\/strong> White strokes, coloured stroke, black stroke, to <code>noStroke<\/code>.<\/p>\n\n\n\n<p><strong>Add some <em>noise<\/em>.<\/strong> One thing we could add some randomness into the colour choice.  Rather than plotting an exact colour, we can add or delete a random value from a fixed colour blue. We are adding a deterministic jitter to the colour value. We can easily achieve this by adding a random value to the colour.  For instance, we can use a random range created by <code>random(-5,5)<\/code>. By choosing a fixed colour blue, we can make a swimming pool tiling pattern, as follows:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-2 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"334\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGridBlue.png\" alt=\"A regular grid of blue rectangles.\" class=\"wp-image-1195\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGridBlue.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGridBlue-300x141.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption>A regular grid of blue rectangles.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"334\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGridBlueJittered.png\" alt=\"A regular grid of blue rectangles that have been jittered.\" class=\"wp-image-1196\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGridBlueJittered.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGridBlueJittered-300x141.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption>A regular grid of blue rectangles that have been jittered.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>We can do the same with the spectrum colour choice: choose the spectrum colour, and then jitter the colour by <code>+random(-5,5)<\/code>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png\" alt=\"A regular grid, with spectrum of colours that have been jittered +-5.\" class=\"wp-image-1197\" width=\"613\" height=\"288\" srcset=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png 712w, https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered-300x141.png 300w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/><figcaption>A regular grid, with spectrum of colours that have been jittered +-5.<\/figcaption><\/figure><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to create a grid of coloured shapes, plotted in Processing.<\/p>\n","protected":false},"author":2,"featured_media":1197,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7,13,16,17],"tags":[32,36,58,61,66,68,69,75,109,117,127],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create a coloured grid in Processing - Project Rainbow<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a coloured grid in Processing - Project Rainbow\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a grid of coloured shapes, plotted in Processing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\" \/>\n<meta property=\"og:site_name\" content=\"Project Rainbow\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-02T18:05:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png\" \/>\n\t<meta property=\"og:image:width\" content=\"712\" \/>\n\t<meta property=\"og:image:height\" content=\"334\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"projectrainbow\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"projectrainbow\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\"},\"author\":{\"name\":\"projectrainbow\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/person\/fa50357aa55dc7c9e38a6114bf64f1f6\"},\"headline\":\"Create a coloured grid in Processing\",\"datePublished\":\"2020-09-02T18:05:07+00:00\",\"dateModified\":\"2020-09-02T18:05:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\"},\"wordCount\":1382,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#organization\"},\"image\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png\",\"keywords\":[\"cell\",\"colour\",\"for-loop\",\"grid\",\"hsb\",\"hue\",\"index\",\"jitter\",\"random\",\"saturation\",\"value\"],\"articleSection\":[\"Beginner\",\"Colours\",\"Java\",\"Processing\",\"Project Rainbow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\",\"url\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\",\"name\":\"Create a coloured grid in Processing - Project Rainbow\",\"isPartOf\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png\",\"datePublished\":\"2020-09-02T18:05:07+00:00\",\"dateModified\":\"2020-09-02T18:05:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage\",\"url\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png\",\"contentUrl\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png\",\"width\":712,\"height\":334,\"caption\":\"Rainbow coloured grid, that has been jittered.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a coloured grid in Processing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#website\",\"url\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/\",\"name\":\"Project Rainbow\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#organization\",\"name\":\"Project Rainbow\",\"url\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/05\/bangor_logo_c1_flush.png\",\"contentUrl\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/05\/bangor_logo_c1_flush.png\",\"width\":3356,\"height\":958,\"caption\":\"Project Rainbow\"},\"image\":{\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/person\/fa50357aa55dc7c9e38a6114bf64f1f6\",\"name\":\"projectrainbow\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/221f8a462bd270b3db788cf44a3c1757?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/221f8a462bd270b3db788cf44a3c1757?s=96&d=mm&r=g\",\"caption\":\"projectrainbow\"},\"url\":\"https:\/\/csee.bangor.ac.uk\/projectrainbow\/author\/projectrainbow\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create a coloured grid in Processing - Project Rainbow","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/","og_locale":"en_US","og_type":"article","og_title":"Create a coloured grid in Processing - Project Rainbow","og_description":"Learn how to create a grid of coloured shapes, plotted in Processing.","og_url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/","og_site_name":"Project Rainbow","article_published_time":"2020-09-02T18:05:07+00:00","og_image":[{"width":712,"height":334,"url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png","type":"image\/png"}],"author":"projectrainbow","twitter_card":"summary_large_image","twitter_misc":{"Written by":"projectrainbow","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#article","isPartOf":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/"},"author":{"name":"projectrainbow","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/person\/fa50357aa55dc7c9e38a6114bf64f1f6"},"headline":"Create a coloured grid in Processing","datePublished":"2020-09-02T18:05:07+00:00","dateModified":"2020-09-02T18:05:07+00:00","mainEntityOfPage":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/"},"wordCount":1382,"commentCount":1,"publisher":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#organization"},"image":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage"},"thumbnailUrl":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png","keywords":["cell","colour","for-loop","grid","hsb","hue","index","jitter","random","saturation","value"],"articleSection":["Beginner","Colours","Java","Processing","Project Rainbow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/","url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/","name":"Create a coloured grid in Processing - Project Rainbow","isPartOf":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#website"},"primaryImageOfPage":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage"},"image":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage"},"thumbnailUrl":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png","datePublished":"2020-09-02T18:05:07+00:00","dateModified":"2020-09-02T18:05:07+00:00","breadcrumb":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#primaryimage","url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png","contentUrl":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/09\/regularGrid-rainbow-colours-jittered.png","width":712,"height":334,"caption":"Rainbow coloured grid, that has been jittered."},{"@type":"BreadcrumbList","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/2020\/09\/02\/create-a-coloured-grid-in-processing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/"},{"@type":"ListItem","position":2,"name":"Create a coloured grid in Processing"}]},{"@type":"WebSite","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#website","url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/","name":"Project Rainbow","description":"","publisher":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#organization","name":"Project Rainbow","url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/logo\/image\/","url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/05\/bangor_logo_c1_flush.png","contentUrl":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-content\/uploads\/sites\/2\/2020\/05\/bangor_logo_c1_flush.png","width":3356,"height":958,"caption":"Project Rainbow"},"image":{"@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/person\/fa50357aa55dc7c9e38a6114bf64f1f6","name":"projectrainbow","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/221f8a462bd270b3db788cf44a3c1757?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/221f8a462bd270b3db788cf44a3c1757?s=96&d=mm&r=g","caption":"projectrainbow"},"url":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/author\/projectrainbow\/"}]}},"_links":{"self":[{"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/posts\/1092"}],"collection":[{"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/comments?post=1092"}],"version-history":[{"count":0,"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/posts\/1092\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/media\/1197"}],"wp:attachment":[{"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/media?parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/categories?post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csee.bangor.ac.uk\/projectrainbow\/wp-json\/wp\/v2\/tags?post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}