Skip to content

Commit

Permalink
Tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
litan committed Dec 3, 2019
1 parent c3a0933 commit 11fd502
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/samples/de/tangram-skier.kojo
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def toCm(p: Double) = 2.54 /96 * p
def tree(distance: Double) {
if (distance > toCm(4)) {
setPenThickness(distance/7)
setPenColor(color(distance.toInt, math.abs(255-distance*3).toInt, 125))
setPenColor(Color(distance.toInt, math.abs(255-distance*3).toInt, 125))
forward(distance)
right(25)
tree(distance*0.8-toCm(2))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/samples/scala-tutorial.kojo
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ println("a procedure")
"""def tree(distance: Double) {
if (distance > 4) {
setPenThickness(distance/7)
setPenColor(color(distance.toInt, Math.abs(255-distance*3).toInt, 125))
setPenColor(Color(distance.toInt, Math.abs(255-distance*3).toInt, 125))
forward(distance)
right(25)
tree(distance*0.8-2)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/samples/sierpinski-tri.kojo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def innerTriangles(n: Double, levels: Int) {

val l = if (levels > 10) 10 else levels
setPenThickness(l)
setPenColor(color(l.toInt*20, l.toInt*25, 100))
setPenColor(Color(l.toInt*20, l.toInt*25, 100))

// left bottom (#1) inner triangle
triangle(n/2)
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/samples/spiral-hexagon-tiles.kojo
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ val speed = 100

// Initial ink colors and tyle type to use
// These will be changed later so use var not val
var firstColor = color(235, 0, 20)
var secondColor = color(20, 0, 235)
var firstColor = Color(235, 0, 20)
var secondColor = Color(20, 0, 235)
var tyleType = 1

// In your own tile pattern, remember to start and end in the bottom-left,
Expand Down Expand Up @@ -245,8 +245,8 @@ for (i <- 0 to loops - 1) { //as loops have shortest arms 0, 1, 2, etc
// We can gradually alter the colors each loop.
// The colors will be (127, 128, 0) and (0, 128, 127) at final loop.
if (loops != 0) { //prevents division by 0 errors
firstColor = color(235 - 128/loops*(i+1), 128/loops*(i+1), 20)
secondColor = color(20, 128/loops*(i+1), 255 - 128/loops*(i+1))
firstColor = Color(235 - 128/loops*(i+1), 128/loops*(i+1), 20)
secondColor = Color(20, 128/loops*(i+1), 255 - 128/loops*(i+1))
}
windSpiral(i)
}
4 changes: 2 additions & 2 deletions src/main/scala/net/kogics/kojo/lite/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package net.kogics.kojo.lite
object Versions {
val KojoMajorVersion = "2.7"
val KojoVersion = "2.7.09"
val KojoRevision = "r23"
val KojoBuildDate = "2 December 2019"
val KojoRevision = "r24"
val KojoBuildDate = "3 December 2019"
val JavaVersion = {
val jrv = System.getProperty("java.runtime.version")
val arch = System.getProperty("os.arch")
Expand Down

0 comments on commit 11fd502

Please sign in to comment.