Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

In the following example we use a parametric type T to define a generic enum type to represent colors. The possible levels of grey or each color component (i.e.: red, green, blue) is stored as a value of the specified type:

To use the Color<T> enum type, we must specify what is T:

(Grey(160), Grey(65280), Rgb(0, 160, 87))

see solution