Unify lane symbol creation and palette automation
This commit is contained in:
parent
15deaea19e
commit
a834ccb1e2
13 changed files with 176 additions and 121 deletions
|
|
@ -406,3 +406,32 @@
|
|||
(is (nil? (:refused extended)) (:refused extended))
|
||||
(is (= [0 6] (node/placed-span
|
||||
(get-in extended [:clip :symbols :palettes :nodes :change]))))))
|
||||
|
||||
(deftest a-blank-palette-symbol-can-tween-from-inherit-to-an-editor-palette
|
||||
(let [day (random-uuid)
|
||||
night (random-uuid)
|
||||
palette (fn [id color]
|
||||
{:id id :name (str id) :slots [{:hex color} {:hex color}]})
|
||||
choice (assoc (ch/keyed {0 pal/inherit 4 night} :linear) :semantic :palette)
|
||||
document {:fps 30 :width 20 :height 20
|
||||
:palettes {day (palette day "#000000")
|
||||
night (palette night "#ffffff")}
|
||||
:default-palette day
|
||||
:symbols
|
||||
{:main {:id :main :frames 5 :palette day :palette-track :palettes
|
||||
:nodes {}}
|
||||
:palettes {:id :palettes :type :palette-track :display :lane :frames 5
|
||||
:nodes {:change {:id :change :kind :instance :z "a1"
|
||||
:source {:symbol :transition}
|
||||
:span [0 5] :time {:at 0}
|
||||
:channels {[:palette] choice}}}}
|
||||
:transition {:id :transition :name "palette transition"
|
||||
:type :palette :frames 1 :nodes {}}}}
|
||||
context (pal/compile document)
|
||||
resolve (clip/resolver document :main nil context nil)]
|
||||
(is (empty? (clip/problems document)))
|
||||
(resolve 2)
|
||||
(is (= {:from day :to night :t 0.5} (clip/active-palette resolve)))
|
||||
(is (= [128 128 128]
|
||||
(nth (pal/effective-ramp context (clip/active-palette resolve))
|
||||
(pal/render-index context day 1))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue