Fledex.Color.KinoRender (fledex v0.7.0)

View Source

This module implements a KinoRender that converts a Fledex color to a markdown representation that can be used in a Livebook and allows nicer rendering of return values. Just return an instance of this module

Fledex.Color.KinoRender.new([color1, color2])

Take a look at this livebook.

Note

For the proper rendering to happen you need to ensure that the protocol consolidation does not happen, by specifying the the consolidate_protocols: false option to Mix.install, i.e.:

Mix.install(
  [
    {:fledex, "~>0.0.0"}
  ],
  consolidate_protocols: false
)

Summary

Guards

Guard to check that the value is within the provided bounds of a byte [0, 255]

Functions

Create a new KinoRender for the specified color

convert to a list of Fledex.Leds

Convert to markdown (i.e. a string)

Guards

is_byte(sub_pixel)

(macro)

Guard to check that the value is within the provided bounds of a byte [0, 255]

Types

t()

@type t() :: %Fledex.Color.KinoRender{colors: [Fledex.Color.Types.color()]}

Functions

new(colors)

Create a new KinoRender for the specified color

to_leds(kino_render)

@spec to_leds(t()) :: Fledex.Leds.t()

convert to a list of Fledex.Leds

to_markdown(colors)

@spec to_markdown(t()) :: binary()

Convert to markdown (i.e. a string)