-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assorted problems in Writing Methods
- Build is updated to versions that work with JVM 21 - Fix errors in styling content - Generate missing image Problem reported by Kim Morgan
- Loading branch information
Showing
7 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ object All extends App { | |
expressive.All | ||
flowers.All | ||
fractals.All | ||
methods.All | ||
programs.All | ||
recursion.All | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package creativescala | ||
package methods | ||
|
||
object All { | ||
WritingMethods | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package creativescala | ||
package methods | ||
|
||
import doodle.core._ | ||
import doodle.image._ | ||
import doodle.syntax.all._ | ||
import doodle.image.syntax.all._ | ||
import doodle.java2d._ | ||
|
||
object WritingMethods { | ||
def box(color: Color, spin: Angle): Image = | ||
Image | ||
.rectangle(40, 40) | ||
.strokeWidth(5.0) | ||
.strokeColor(color.spin(spin + 30.degrees)) | ||
.fillColor(color.spin(spin)) | ||
|
||
def gradientBoxes(color: Color): Image = { | ||
box(color, 0.degrees) | ||
.beside(box(color, 15.degrees)) | ||
.beside(box(color, 20.degrees)) | ||
.beside(box(color, 45.degrees)) | ||
.beside(box(color, 60.degrees)) | ||
} | ||
|
||
gradientBoxes(Color.royalBlue).save("methods/gradient-boxes") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.8.2 | ||
sbt.version = 1.9.7 |