(launch-angle-rad origin spread-deg r)Compute the launch angle (radians) for a particle, given the burst origin
and a uniform random in [0,1]. The base direction depends on origin:
top → downward, center → omni, bottom → upward, point → omni.
spread-deg is the half-angle (so 60 means ±60°).
Compute the launch angle (radians) for a particle, given the burst origin and a uniform random in [0,1]. The base direction depends on `origin`: top → downward, center → omni, bottom → upward, point → omni. `spread-deg` is the half-angle (so 60 means ±60°).
(normalize {:keys [mode-raw origin-raw count-raw spread-raw velocity-raw
gravity-raw duration-raw colors-raw shapes-raw auto-fire?
disabled?]})Normalise raw attribute strings into a stable view-model map.
Input keys: :mode-raw, :origin-raw, :count-raw, :spread-raw, :velocity-raw, :gravity-raw, :duration-raw, :colors-raw, :shapes-raw, :auto-fire? (bool), :disabled? (bool)
Output keys: :mode, :origin, :count, :spread, :velocity, :gravity, :duration, :colors (vec), :shapes (vec), :auto-fire?, :disabled?
Normalise raw attribute strings into a stable view-model map. Input keys: :mode-raw, :origin-raw, :count-raw, :spread-raw, :velocity-raw, :gravity-raw, :duration-raw, :colors-raw, :shapes-raw, :auto-fire? (bool), :disabled? (bool) Output keys: :mode, :origin, :count, :spread, :velocity, :gravity, :duration, :colors (vec), :shapes (vec), :auto-fire?, :disabled?
(origin-point origin w h ox oy)Return the [x y] origin pixel for a burst, given canvas dimensions and
the requested origin mode. For point, falls back to canvas center if
the supplied coordinates are nil.
Return the [x y] origin pixel for a burst, given canvas dimensions and the requested origin mode. For `point`, falls back to canvas center if the supplied coordinates are nil.
(parse-colors s)Parse the colors attribute into a vector of CSS color strings.
Empty / missing → returns default-palette.
Parse the `colors` attribute into a vector of CSS color strings. Empty / missing → returns `default-palette`.
(parse-shapes s)Parse the shapes attribute into a vector of allowed shape keywords.
Filters out unknown values; falls back to defaults when the result is empty.
Parse the `shapes` attribute into a vector of allowed shape keywords. Filters out unknown values; falls back to defaults when the result is empty.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |