Chroma.js in CoronaSDK

Hello everyone!

I have been thinking about a game and I would like to use chroma.js library to help me in my creation. The idea is to have something that helps to to create the colors between 2 colors and with as many steps as I would need.

Ex. 9 Colors between red and blue.

As I’m not very expert on this… Is there any way I can use that library?

Thanks a lot.

Corona cannot use .js (JavaScript) files unless you’re building a native.newWebView() object. However, JavaScript is pretty “C” like and it doesn’t sound like it would be difficult to convert to Lua.

Rob

Thanks for your very quick reply sir!

Is this something that may come in the future? I think there is a lot of interesting stuff out there and it will save us time to use it directly without the need of conversion :slight_smile:

Before starting to convert things… Do we have in Corona something similar to interpolate colors between 2 colors? I was not able to find anything.

Again, thanks Rob!

Maybe try simple Color Tween module or more robust library transition2

ldurniat

Hello again!

Thanks for your help with these libraries! I think I knew ColorTween from before or at least a pretty similar one.

Honestly, as I know that a game named “I Love Hue” was created using Corona and for the sake of practicing myself, I started wondering about how they made it.

Maybe they just converted the library I posted (Chroma.js) to Lua and play with it (or at least the parts they needed).

I think it would be interesting to support JS as there are so many functions out there that we can use without the need to create them again. Maybe that will happen in the future :slight_smile:

If for any reason JS is supported or there is any native way to support color steps in the future, please, do not hesitate to reply here as I think is a pretty interesting feature.

I will keep doing some research and I will post it here if I find anything.

Thanks a lot!

Best regards,

Juanjo

Corona cannot use .js (JavaScript) files unless you’re building a native.newWebView() object. However, JavaScript is pretty “C” like and it doesn’t sound like it would be difficult to convert to Lua.

Rob

Thanks for your very quick reply sir!

Is this something that may come in the future? I think there is a lot of interesting stuff out there and it will save us time to use it directly without the need of conversion :slight_smile:

Before starting to convert things… Do we have in Corona something similar to interpolate colors between 2 colors? I was not able to find anything.

Again, thanks Rob!

Maybe try simple Color Tween module or more robust library transition2

ldurniat

Hello again!

Thanks for your help with these libraries! I think I knew ColorTween from before or at least a pretty similar one.

Honestly, as I know that a game named “I Love Hue” was created using Corona and for the sake of practicing myself, I started wondering about how they made it.

Maybe they just converted the library I posted (Chroma.js) to Lua and play with it (or at least the parts they needed).

I think it would be interesting to support JS as there are so many functions out there that we can use without the need to create them again. Maybe that will happen in the future :slight_smile:

If for any reason JS is supported or there is any native way to support color steps in the future, please, do not hesitate to reply here as I think is a pretty interesting feature.

I will keep doing some research and I will post it here if I find anything.

Thanks a lot!

Best regards,

Juanjo