Skip to content

Color

enum Color : Enum<Color> 

The different card colors.

When implementing a UI for the game, this doesn't need to be colors! These could be replaced by symbols, icons, text, different colors, or anything else as long as it's recognizable.

Entries

Red

Red

Green

Blue

Purple

Yellow

Brown

Types

Companion

object Companion

Properties

entries

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.

name

expect val name: String

ordinal

expect val ordinal: Int

Functions

valueOf

fun valueOf(value: String): Color

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws

kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

fun values(): Array<Color>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.