MackeyRMS/elm-accessors/3.1.0

Color.Hex.Accessors

Color.Hex.Accessors

color : Prism pr String Color x y

color: This accessor lets you convert between tesk9/palette TransparentColor && SolidColor

import Accessors exposing (swap, new, try)
import Color
import Color.Hex.Accessors as Hex




new (Hex.color) Color.red
-->  "#cc0000"
try (Hex.color) "#C00F" -- with alpha channel
--> Just Color.red
palette : Prism pr String TransparentColor x y

palette: This accessor lets you convert between tesk9/palette TransparentColor && SolidColor

import Accessors exposing (swap, new, try)
import Color
import Color.Hex.Accessors as Hex
import Color.Palette.Accessors as Palette




new (Hex.palette << swap Palette.transparent) Color.red
-->  "#CC0000"
try (Hex.palette << swap Palette.transparent) "#C00F" -- with alpha channel
--> Just Color.red
ui : Prism pr String Color x y

ui: This accessor lets you convert between tesk9/palette TransparentColor && SolidColor

import Accessors exposing (swap, new, try)
import Color
import Color.Hex.Accessors as Hex
import Color.ElmUI.Accessors as UI




new (Hex.ui << swap UI.color) Color.red
-->  "#cc0000"
try (Hex.ui << swap UI.color) "#C00F" -- with alpha channel
--> Just Color.red