Skip to content

Commit 3a7bb7f

Browse files
Merge pull request #295 from guillemontecinos/master
Fixing escape characters in src/data/en.yml
2 parents fc6b5ad + 6d008d6 commit 3a7bb7f

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

src/data/en.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -431,40 +431,35 @@ color:
431431
color-description1: "This tutorial is from the book Learning Processing by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. It was ported to P5 by Kelly Chang. If you see any errors or have comments, "
432432
color-description2: " please let us know."
433433
color-title: "Color"
434-
color-p1x1: "In the digital world, when we want to talk about a color, precision is required. Saying "Hey, can you make that circle bluish-green?" will not do. Color, rather, is defined as a range of numbers. Let's start with the simplest case: black & white or grayscale. 0 means black, 255 means white. In between, every other number—50, 87, 162, 209, and so on—is a shade of gray ranging from black to white."
434+
color-p1x1: "In the digital world, when we want to talk about a color, precision is required. Saying \"Hey, can you make that circle bluish-green?\" will not do. Color, rather, is defined as a range of numbers. Let's start with the simplest case: black & white or grayscale. 0 means black, 255 means white. In between, every other number—50, 87, 162, 209, and so on—is a shade of gray ranging from black to white."
435435
color-p2x1: "By adding the "
436436
color-p2x2: " and "
437-
color-p2x3: " functions before something is drawn, we can set the color of any given shape.
438-
There is also the function "
437+
color-p2x3: " functions before something is drawn, we can set the color of any given shape. There is also the function "
439438
color-p2x4: ", which sets a background color for the window. Here's an example."
440-
color-code1: "background(255); // Setting the background to white
441-
stroke(0); // Setting the outline (stroke) to black
442-
fill(150); // Setting the interior of a shape (fill) to grey
443-
rect(50,50,75,100); // Drawing the rectangle"
439+
color-code1: "background(255); // Setting the background to white \n stroke(0); // Setting the outline (stroke) to black \n fill(150); // Setting the interior of a shape (fill) to grey \n rect(50,50,75,100); // Drawing the rectangle"
444440
color-p3x1: "Stroke or fill can be eliminated with the functions: "
445441
color-p3x2: " and "
446-
color-p3x3: ". Our instinct might be to say "stroke(0)" for no outline, however, it is important to remember that 0 is not "nothing", but rather denotes the color black.
447-
Also, remember not to eliminate both—with "
442+
color-p3x3: ". Our instinct might be to say \"stroke(0)\" for no outline, however, it is important to remember that 0 is not \"nothing\", but rather denotes the color black. Also, remember not to eliminate both—with "
448443
color-p3x4: " and "
449444
color-p3x5: ", nothing will appear!"
450445
color-p4x1: "In addition, if we draw two shapes, p5.js will always use the most recently specified stroke and fill, reading the code from top to bottom."
451446
rgb-color-title: "RGB Color"
452-
rgb-color-p1x1: "Remember finger painting? By mixing three "primary" colors, any color could be generated. Swirling all colors together resulted in a muddy brown. The more paint you added, the darker it got. Digital colors are also constructed by mixing three primary colors, but it works differently from paint. First, the primaries are diff erent: red, green, and blue (i.e., "RGB" color). And with color on the screen, you are mixing light, not paint, so the mixing rules are different as well."
447+
rgb-color-p1x1: "Remember finger painting? By mixing three \"primary\" colors, any color could be generated. Swirling all colors together resulted in a muddy brown. The more paint you added, the darker it got. Digital colors are also constructed by mixing three primary colors, but it works differently from paint. First, the primaries are different: red, green, and blue (i.e., \"RGB\" color). And with color on the screen, you are mixing light, not paint, so the mixing rules are different as well."
453448
rgb-color-li1: "Red + Green = Yellow"
454449
rgb-color-li2: "Red + Blue = Purple"
455450
rgb-color-li3: "Green + Blue = Cyan (blue-green)"
456451
rgb-color-li4: "Red + Green + Blue = White"
457452
rgb-color-li5: "No colors = Black"
458-
rgb-color-p2x1: "This assumes that the colors are all as bright as possible, but of course, you have a range of color available, so some red plus some green plus some blue equals gray, and a bit of red plus a bit of blue equals dark purple. While this may take some getting used to, the more you program and experiment with RGB color, the more it will become instinctive, much like swirling colors with your fingers. And of course you can't say "Mix some red with a bit of blue," you have to provide an exact amount. As with grayscale, the individual color elements are expressed as ranges from 0 (none of that color) to 255 (as much as possible), and they are listed in the order R, G, and B. You will get the hang of RGB color mixing through experimentation, but next we will cover some code using some common colors."
453+
rgb-color-p2x1: "This assumes that the colors are all as bright as possible, but of course, you have a range of color available, so some red plus some green plus some blue equals gray, and a bit of red plus a bit of blue equals dark purple. While this may take some getting used to, the more you program and experiment with RGB color, the more it will become instinctive, much like swirling colors with your fingers. And of course you can't say \"Mix some red with a bit of blue,\" you have to provide an exact amount. As with grayscale, the individual color elements are expressed as ranges from 0 (none of that color) to 255 (as much as possible), and they are listed in the order R, G, and B. You will get the hang of RGB color mixing through experimentation, but next we will cover some code using some common colors."
459454
color-transparency-title: "Color Transparency"
460-
color-transparency-p1x1: "In addition to the red, green, and blue components of each color, there is an additional optional fourth component, referred to as the color's "alpha." Alpha means transparency and is particularly useful when you want to draw elements that appear partially see-through on top of one another. The alpha values for an image are sometimes referred to collectively as the "alpha channel" of an image."
461-
color-transparency-p2x1: "It is important to realize that pixels are not literally transparent, this is simply a convenient illusion that is accomplished by blending colors. Behind the scenes, p5.js takes the color numbers and adds a percentage of one to a percentage of another, creating the optical perception of blending. (If you are interested in programming "rose-colored" glasses, this is where you would begin.)"
455+
color-transparency-p1x1: "In addition to the red, green, and blue components of each color, there is an additional optional fourth component, referred to as the color's \"alpha\". Alpha means transparency and is particularly useful when you want to draw elements that appear partially see-through on top of one another. The alpha values for an image are sometimes referred to collectively as the \"alpha channel\" of an image."
456+
color-transparency-p2x1: "It is important to realize that pixels are not literally transparent, this is simply a convenient illusion that is accomplished by blending colors. Behind the scenes, p5.js takes the color numbers and adds a percentage of one to a percentage of another, creating the optical perception of blending. (If you are interested in programming \"rose-colored\" glasses, this is where you would begin.)"
462457
color-transparency-p3x1: "Alpha values also range from 0 to 255, with 0 being completely transparent (i.e., 0% opaque) and 255 completely opaque (i.e., 100% opaque)."
463458
custom-color-ranges-title: "Custom Color Ranges"
464459
custom-color-ranges-p1x1: "RGB color with ranges of 0 to 255 is not the only way you can handle color in p5.js, in fact, it allows us to think about color any way we like. For example, you might prefer to think of color as ranging from 0 to 100 (like a percentage). You can do this by specifying a custom "
465-
custom-color-ranges-p2x1: "The above function says: "OK, we want to think about color in terms of red, green, and blue. The range of RGB values will be from 0 to 100.""
460+
custom-color-ranges-p2x1: "The above function says: \"OK, we want to think about color in terms of red, green, and blue. The range of RGB values will be from 0 to 100.\""
466461
custom-color-ranges-p3x1: "Although it is rarely convenient to do so, you can also have different ranges for each color component:"
467-
custom-color-ranges-p4x1: "Now we are saying "Red values go from 0 to 100, green from 0 to 500, blue from 0 to 10, and alpha from 0 to 255.""
462+
custom-color-ranges-p4x1: "Now we are saying \"Red values go from 0 to 100, green from 0 to 500, blue from 0 to 10, and alpha from 0 to 255.\""
468463
custom-color-ranges-p5x1: "Finally, while you will likely only need RGB color for all of your programming needs, you can also specify colors in the HSB (hue, saturation, and brightness) mode. Without getting into too much detail, HSB color works as follows:"
469464
custom-color-ranges-li1x1: "Hue"
470465
custom-color-ranges-li1x2: "—The color type, ranges from 0 to 255 by default."
@@ -483,10 +478,10 @@ coordinate-system:
483478
coordinate-system-description5: "."
484479
coordinate-system-description-title: "Coordinate System and Shapes"
485480
coordinate-system-description-p1x1: "Before we begin programming with p5, we must first channel our eighth grade selves, pull out a piece of graph paper, and draw a line. The shortest distance between two points is a good old fashioned line, and this is where we begin, with two points on that graph paper."
486-
coordinate-system-description-p2x1: "The above figure shows a line between point A (1,0) and point B (4,5). If you wanted to direct a friend of yours to draw that same line, you would give them a shout and say "draw a line from the point one-zero to the point four-five, please." Well, for the moment, imagine your friend was a computer and you wanted to instruct this digital pal to display that same line on its screen. The same command applies (only this time you can skip the pleasantries and you will be required to employ a precise formatting). Here, the instruction will look like this:"
487-
coordinate-system-description-p3x1: "Even without having studied the syntax of writing code, the above statement should make a fair amount of sense. We are providing a command (which we will refer to as a "function") for the machine to follow entitled "line." In addition, we are specifying some arguments for how that line should be drawn, from point A (1,0) to point B (4,5). If you think of that line of code as a sentence, the function is a verb and the arguments are the objects of the sentence. The code sentence also ends with a semicolon instead of a period."
488-
coordinate-system-description-p4x1: "The key here is to realize that the computer screen is nothing more than a fancier piece of graph paper. Each pixel of the screen is a coordinate - two numbers, an "x" (horizontal) and a "y" (vertical) - that determines the location of a point in space. And it is our job to specify what shapes and colors should appear at these pixel coordinates."
489-
coordinate-system-description-p5x1: "Nevertheless, there is a catch here. The graph paper from eighth grade ("Cartesian coordinate system") placed (0,0) in the center with the y-axis pointing up and the x-axis pointing to the right (in the positive direction, negative down and to the left). The coordinate system for pixels in a computer window, however, is reversed along the y-axis. (0,0) can be found at the top left with the positive direction to the right horizontally and down vertically."
481+
coordinate-system-description-p2x1: "The above figure shows a line between point A (1,0) and point B (4,5). If you wanted to direct a friend of yours to draw that same line, you would give them a shout and say \"draw a line from the point one-zero to the point four-five, please.\" Well, for the moment, imagine your friend was a computer and you wanted to instruct this digital pal to display that same line on its screen. The same command applies (only this time you can skip the pleasantries and you will be required to employ a precise formatting). Here, the instruction will look like this:"
482+
coordinate-system-description-p3x1: "Even without having studied the syntax of writing code, the above statement should make a fair amount of sense. We are providing a command (which we will refer to as a \"function\") for the machine to follow entitled \"line.\" In addition, we are specifying some arguments for how that line should be drawn, from point A (1,0) to point B (4,5). If you think of that line of code as a sentence, the function is a verb and the arguments are the objects of the sentence. The code sentence also ends with a semicolon instead of a period."
483+
coordinate-system-description-p4x1: "The key here is to realize that the computer screen is nothing more than a fancier piece of graph paper. Each pixel of the screen is a coordinate - two numbers, an \"x\" (horizontal) and a \"y\" (vertical) - that determines the location of a point in space. And it is our job to specify what shapes and colors should appear at these pixel coordinates."
484+
coordinate-system-description-p5x1: "Nevertheless, there is a catch here. The graph paper from eighth grade (\"Cartesian coordinate system\") placed (0,0) in the center with the y-axis pointing up and the x-axis pointing to the right (in the positive direction, negative down and to the left). The coordinate system for pixels in a computer window, however, is reversed along the y-axis. (0,0) can be found at the top left with the positive direction to the right horizontally and down vertically."
490485
simple-shapes-title: "Simple Shapes"
491486
simple-shapes-p1x1: "The vast majority of the programming examples you'll see with p5 are visual in nature. These examples, at their core, involve drawing shapes and setting pixels. Let's begin by looking at four primitive shapes."
492487
simple-shapes-p2x1: "For each shape, we will ask ourselves what information is required to specify the location and size (and later color) of that shape and learn how p5 expects to receive that information. In each of the diagrams below, we'll assume a window with a width of 10 pixels and height of 10 pixels. This isn't particularly realistic since when you really start coding you will most likely work with much larger windows (10x10 pixels is barely a few millimeters of screen space.) Nevertheless for demonstration purposes, it is nice to work with smaller numbers in order to present the pixels as they might appear on graph paper (for now) to better illustrate the inner workings of each line of code."
@@ -506,7 +501,7 @@ coordinate-system:
506501
simple-shapes-p8x4: " is "
507502
simple-shapes-p8x5: ", rather than "
508503
simple-shapes-p8x6: "."
509-
simple-shapes-p9x1: "It is important to acknowledge that these ellipses do not look particularly circular. p5 has a built-in methodology for selecting which pixels should be used to create a circular shape. Zoomed in like this, we get a bunch of squares in a circle-like pattern, but zoomed out on a computer screen, we get a nice round ellipse. p5 also gives us the power to develop our own algorithms for coloring in individual pixels (in fact, we can already imagine how we might do this using "point" over and over again), but for now, we are content with allowing the "ellipse" statement to do the hard work. (For more about pixels, start with: the "
504+
simple-shapes-p9x1: "It is important to acknowledge that these ellipses do not look particularly circular. p5 has a built-in methodology for selecting which pixels should be used to create a circular shape. Zoomed in like this, we get a bunch of squares in a circle-like pattern, but zoomed out on a computer screen, we get a nice round ellipse. p5 also gives us the power to develop our own algorithms for coloring in individual pixels (in fact, we can already imagine how we might do this using \"point\" over and over again), but for now, we are content with allowing the \"ellipse\" statement to do the hard work. (For more about pixels, start with: the "
510505
simple-shapes-p9x2: "pixels reference page"
511506
simple-shapes-p9x3: ", though be warned this is a great deal more advanced than this tutorial.)"
512507
simple-shapes-p10x1: "Now let's look at what some code with shapes in more realistic setting, with window dimensions of 200 by 200. Note the use of the createCanvas() function to specify the width and height of the window."

0 commit comments

Comments
 (0)