Fork me on GitHub
#cljsjs
<
2016-08-18
>
talexxx05:08:25

So console.log(chroma.scale(['white', 'black']).colors(2)); produces ["#00000", "#ffffff"] in JS as expected

talexxx05:08:00

In a bREPL: ((.-colors ((.-scale js/chroma) ["white" "black"])) 2) produces

#object[TypeError TypeError: a is undefined]
No stacktrace available.

talexxx05:08:57

In fact, any argument larger than 1 at the end produces that error.

talexxx06:08:46

A JS sketch I've been using to verify my ported functions as I go, with the expected JS output logged: https://tonicdev.com/57b52d0f7b3754140064e49c/57b535eead6238140016554b

talexxx06:08:55

Is there something more I can do to figure this bug out? Thanks. This packaging setup has been pretty exciting.

akiroz13:08:16

wild guess, worth a try:

clojure
(-> js/chroma
    (.scale #js["white" "black"])
    (.colors 2))

talexxx16:08:30

Couldn’t make the thread form work, but...

talexxx16:08:30

hallo-color.app=> ((.-colors ((.-scale js/chroma) #js["white" "black"])) 2)
#js ["#ffffff" "#000000"]
hallo-color.app=> ((.-colors ((.-scale js/chroma) ["white" "black"])) 2)

#object[TypeError TypeError: a is undefined]
No stacktrace available.