works.iterative.ui.components.laminar.tailwind.color

We need a generic Color model that can be used both on server and on client.

We have adopted the Tailwind model for now. There is nothing inherently Tailwind-specific in the implementation, but all the values are taken from their palette and the area model is very HTML biased.

Still, I think that it is a good starting point for exploration and will satisfy our current needs.

Attributes

Members list

Type members

Classlikes

case class Color(area: ColorArea, color: ColorDef)

Complete color definition that can be rendered to CSS.

Complete color definition that can be rendered to CSS.

Includes the area, kind and weight of the color.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Color

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Color.type
enum ColorArea(val name: String)

Defines the area the color should apply to, eg. background, text, border, etc.

Defines the area the color should apply to, eg. background, text, border, etc.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ColorDef

A combination of ColorKind and ColorWeight, if applicable.

A combination of ColorKind and ColorWeight, if applicable.

By applying area we get the full Color definition.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ColorDef

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ColorDef.type
sealed abstract class ColorKind

Defines what color should be used, without specifying the area or weight.

Defines what color should be used, without specifying the area or weight.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object amber
object auto
object black
object blue
object current
object cyan
object emerald
object fuchsia
object gray
object green
object indigo
object inherit
object lime
object neutral
object orange
object pink
object purple
object red
object rose
object sky
object slate
object stone
object teal
object transp
object violet
object white
object yellow
object zinc
Show all
object ColorKind

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ColorKind.type
object ColorWeight

Defines weight of a color, eg. 50, 100, 200, etc.

Defines weight of a color, eg. 50, 100, 200, etc.

Tailwind-like.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Types

opaque type ColorWeight

Extensions

Extensions

extension (c: ColorWeight)
def value: String