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
package pl.info.czerwinski | |
enum class MaterialColor(val tones: Map<Int, Int> = emptyMap(), val accentTones: Map<Int, Int> = emptyMap(), val singleColor: Int? = null) { | |
RED( | |
tones = mapOf( | |
50 to 0xFFEBEE, | |
100 to 0xFFCDD2, | |
200 to 0xEF9A9A, | |
300 to 0xE57373, | |
400 to 0xEF5350, |
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
package pl.info.czerwinski.geom | |
class SquareMatrix(val size: Int, private val elements: (Int, Int) -> Float) { | |
operator fun get(row: Int, col: Int): Float { | |
require(row in 0..size - 1) { "Row ${row} out of bounds: 0..${size - 1}" } | |
require(col in 0..size - 1) { "Column ${col} out of bounds: 0..${size - 1}" } | |
return elements(row, col) | |
} |
NewerOlder