If I have a class called `Colour(val red:Double, v...
# getting-started
p
If I have a class called
Colour(val red:Double, val green: Double, val Blue: Double)
what's the best way of defining some pre-defined colours, e.g. White being
Colour(1.0,1.0,1.0)
?
d
Copy code
object Colours {
   val White = Colour(1.0,1.0,1.0)
}
4
d
val WHITE = Colour(...)
in the companion object for
Colour
.
2
p
Thanks !