(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only)
     ["%" \\format (.only format)]]
    [collection
     ["[0]" list (.use "[1]#[0]" monoid)]]]
   [math
    [number
     ["[0]" nat (.use "hex#[0]" hex)]]]]]
 [\\library
  ["[0]" / (.only)
   ["/[1]" //]]])

(def description
  (template (_ <name>)
    [($.definition <name>
       (let [[red green blue] (//.rgb <name>)
             [_ name] (symbol <name>)]
         (format "R:" (hex#encoded red)
                 " G:" (hex#encoded green)
                 " B:" (hex#encoded blue)
                 " | " (text.replaced "_" " " name))))]))

(`` (def .public documentation
      (List $.Documentation)
      (let [a-c (list (,, (with_template [<name>]
                            [(description <name>)]

                            [/.alice_blue]
                            [/.antique_white]
                            [/.aqua]
                            [/.aquamarine]
                            [/.azure]
                            [/.beige]
                            [/.bisque]
                            [/.black]
                            [/.blanched_almond]
                            [/.blue]
                            [/.blue_violet]
                            [/.brown]
                            [/.burly_wood]
                            [/.cadet_blue]
                            [/.chartreuse]
                            [/.chocolate]
                            [/.coral]
                            [/.cornflower_blue]
                            [/.cornsilk]
                            [/.crimson]
                            [/.cyan]
                            )))
            d-k (list (,, (with_template [<name>]
                            [(description <name>)]

                            [/.dark_blue]
                            [/.dark_cyan]
                            [/.dark_goldenrod]
                            [/.dark_gray]
                            [/.dark_green]
                            [/.dark_khaki]
                            [/.dark_magenta]
                            [/.dark_olive_green]
                            [/.dark_orange]
                            [/.dark_orchid]
                            [/.dark_red]
                            [/.dark_salmon]
                            [/.dark_sea_green]
                            [/.dark_slate_blue]
                            [/.dark_slate_gray]
                            [/.dark_turquoise]
                            [/.dark_violet]
                            [/.deep_pink]
                            [/.deep_sky_blue]
                            [/.dim_gray]
                            [/.dodger_blue]
                            [/.fire_brick]
                            [/.floral_white]
                            [/.forest_green]
                            [/.fuchsia]
                            [/.gainsboro]
                            [/.ghost_white]
                            [/.gold]
                            [/.goldenrod]
                            [/.gray]
                            [/.green]
                            [/.green_yellow]
                            [/.honey_dew]
                            [/.hot_pink]
                            [/.indian_red]
                            [/.indigo]
                            [/.ivory]
                            [/.khaki]
                            )))
            l-o (list (,, (with_template [<name>]
                            [(description <name>)]

                            [/.lavender]
                            [/.lavender_blush]
                            [/.lawn_green]
                            [/.lemon_chiffon]
                            [/.light_blue]
                            [/.light_coral]
                            [/.light_cyan]
                            [/.light_goldenrod_yellow]
                            [/.light_gray]
                            [/.light_green]
                            [/.light_pink]
                            [/.light_salmon]
                            [/.light_sea_green]
                            [/.light_sky_blue]
                            [/.light_slate_gray]
                            [/.light_steel_blue]
                            [/.light_yellow]
                            [/.lime]
                            [/.lime_green]
                            [/.linen]
                            [/.magenta]
                            [/.maroon]
                            [/.medium_aquamarine]
                            [/.medium_blue]
                            [/.medium_orchid]
                            [/.medium_purple]
                            [/.medium_sea_green]
                            [/.medium_slate_blue]
                            [/.medium_spring_green]
                            [/.medium_turquoise]
                            [/.medium_violet_red]
                            [/.midnight_blue]
                            [/.mint_cream]
                            [/.misty_rose]
                            [/.moccasin]
                            [/.navajo_white]
                            [/.navy]
                            [/.old_lace]
                            [/.olive]
                            [/.olive_drab]
                            [/.orange]
                            [/.orange_red]
                            [/.orchid]
                            )))
            p-y (list (,, (with_template [<name>]
                            [(description <name>)]

                            [/.pale_goldenrod]
                            [/.pale_green]
                            [/.pale_turquoise]
                            [/.pale_violet_red]
                            [/.papaya_whip]
                            [/.peach_puff]
                            [/.peru]
                            [/.pink]
                            [/.plum]
                            [/.powder_blue]
                            [/.purple]
                            [/.rebecca_purple]
                            [/.red]
                            [/.rosy_brown]
                            [/.royal_blue]
                            [/.saddle_brown]
                            [/.salmon]
                            [/.sandy_brown]
                            [/.sea_green]
                            [/.sea_shell]
                            [/.sienna]
                            [/.silver]
                            [/.sky_blue]
                            [/.slate_blue]
                            [/.slate_gray]
                            [/.snow]
                            [/.spring_green]
                            [/.steel_blue]
                            [/.tan]
                            [/.teal]
                            [/.thistle]
                            [/.tomato]
                            [/.turquoise]
                            [/.violet]
                            [/.wheat]
                            [/.white]
                            [/.white_smoke]
                            [/.yellow]
                            [/.yellow_green]
                            )))]
        (list.partial ($.module /._
                                "")

                      (all list#composite
                           a-c
                           d-k
                           l-o
                           p-y
                           )))))
