manganese_serialization_kit v0.2.4 Manganese.SerializationKit.Structs.UnityColor

A Unity color stored in RGB/RGBA format.

This module can be used as an Ecto type for de/serialization when interacting with the database.

Deserialization

See from_string/1

Serialization

The color struct implements the String.Chars protocol.

Link to this section Summary

Types

t()

A Unity color.

Functions

Deserialize a color from a map.

Deserialize a color from a string.

Serialize a color to a map.

The PostgreSQL composite type used to represent a color.

Link to this section Types

Link to this type

t()
t() :: %Manganese.SerializationKit.Structs.UnityColor{
  alpha: float(),
  blue: float(),
  green: float(),
  red: float()
}

A Unity color.

Link to this section Functions

Link to this function

from_map(map)
from_map(map()) :: t()

Deserialize a color from a map.

Link to this function

from_string(string)
from_string(String.t()) :: t()

Deserialize a color from a string.

The expected format is a "#" followed by 3, 4, 6, or 8 hexadecimal digits.

Link to this function

to_map(unity_color)
to_map(t()) :: map()

Serialize a color to a map.

Link to this function

type()
type() :: :string

The PostgreSQL composite type used to represent a color.