OklabColor.fromHex constructor

OklabColor.fromHex(
  1. String hex
)

Constructs an OklabColor from a RGB hex color.

hex is case-insensitive and must be 3 or 6 characters in length, excluding an optional leading #.

Implementation

factory OklabColor.fromHex(String hex) => cm.OklabColor.fromHex(hex).cast();