Learn programming 5: Light speed effect, change line colors
-
Not SyncedOn the first day we were drawing dots and lines, but they were all black.
-
Not SyncedLet's check out how we can change the color of those lines.
-
Not SyncedWe quickly saw yesterday that 'stroke' is used to change it.
-
Not SyncedWe didn't try it out, but we opened this page here and saw stroke can change the color of the border.
-
Not SyncedIn the same way, 'background' changes the whole background of the screen.
-
Not Synced'stroke' changes the color of the next drawing action.
-
Not SyncedSee? "Sets the color used to draw lines and borders around shapes."
-
Not SyncedSo it looks like it works the same way as background.
-
Not SyncedYou can have stroke with one number. So you get a grey value, or you can make a stroke with three RGB values.
-
Not SyncedSo then we'll call 'stroke' first and then draw lines.
-
Not SyncedIf this is RGB, the first value is red, then green and blue. This way we can make a red line.
-
Not SyncedNow, what's the syntax for line?
-
Not SyncedWe have 'line();' and in the middle we have to enter four numbers.
- Title:
- Learn programming 5: Light speed effect, change line colors
- Description:
-
Learn how to change line colors and make some kind of disco laser effect and a very simple light speed effect. We also show the option to auto-format the source code, which adds and removes spaces to make it all beautifully aligned.
- Video Language:
- English
- Duration:
- 08:52