2021-08-29 02:04:54 +00:00
|
|
|
(local {: pal : gs-to-rgb} (require :editor.tiledraw.iigs))
|
2021-09-12 04:18:21 +00:00
|
|
|
(local lume (require :lib.lume))
|
2021-08-29 02:04:54 +00:00
|
|
|
|
2021-09-12 04:18:21 +00:00
|
|
|
{:map-bitxy (fn [self x y] (values (+ (* y 16) x) 0 0xff))
|
|
|
|
:pixel-color (fn [self b] (match b 0xf0 (values [128 128 128] [64 64 64])
|
|
|
|
_ (gs-to-rgb (. pal (+ b 1)))))
|
|
|
|
:draw-bits #(if (= $1.icolor 17) 0xf0 (- $1.icolor 1))
|
|
|
|
:palette #(lume.concat (icollect [_ color (ipairs pal)] (gs-to-rgb color)) [[255 0 255]])
|
|
|
|
:pixel-storage-divisor #1
|
2021-08-29 02:04:54 +00:00
|
|
|
}
|
|
|
|
|