Values passed as enum constructor arguments can be captured into variables by use of pattern matching.
Assume the following enum:
enum Color {
RGB(r : Int, g : Int, b : Int);
HSV(h : Int, s : Float, v : Float);
}
The red channel value can be captured as follows:
var color = Color.RG...