kandy 0.7.0 Help

Ktnb Logo Tiles

val zipperCells = (0 until 40).flatMap { x -> val n = 3 val sector = if (x <= 15) { 0 } else if (x <= 23) { 1 } else 2 when (sector) { 0 -> { (0 until n).map { y -> x to x + (x - 1) / 2 + y } } 1 -> { (0 until n).map { y -> x to 38 - x + y } } else -> { (0 until n).map { y -> x to x - 11 + (x - 19) / 2 + y } } } } val cells = (0 until 40).flatMap { x -> (0 until 40).map { y -> x to y } }.filter { it !in zipperCells } val xs = cells.map { it.first } val ys = cells.map { it.second } val colorFactor = xs.zip(ys).map { it.first + it.second } plot { tiles { x(xs) y(ys) fillColor(colorFactor) { scale = continuous(Color.hex("#7d52fc")..Color.hex("#e34860")) legend.type = LegendType.None } } layout { style(Style.Void) } }
Ktnb Logo Tiles
Last modified: 26 March 2024