cljsjs

2016-08-18T05:56:25.000395Z

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

2016-08-18T05:57:00.000396Z

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

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

2016-08-18T05:58:57.000398Z

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

2016-08-18T06:02:59.000399Z

Can be reproduced with https://github.com/talexand/hallo-color

2016-08-18T06:04:46.000401Z

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

2016-08-18T06:06:55.000403Z

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

2016-08-18T13:49:16.000404Z

wild guess, worth a try:

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

2016-08-18T16:44:30.000406Z

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

2016-08-18T16:44:30.000407Z

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.