Skip to content

Comment on Show HN: AI color palette generator for Tailwindcss

Comments

So what exactly is AI about it? It just looks like a common algorithm that matches colors together and not some AI that has been trained to find matching color palettes.

It uses two neural networks trained with the original tailwind palette. Here is the GitHub page with more info:

https://github.com/dmarman/dmarman.github.io

According to the README [0] it's using neural networks:

It uses two neural networks to predict the full palette. The first, model.js it predicts all the shades vertically from 50-900 given a certain color as input. The second, nextModel.js predicts horizontally all the colors horizontally given a certain shade as input.

[0]: https://github.com/dmarman/dmarman.github.io

Yeah but if you look at the code it doesn't really predict anything on trained data etc.

It's not really a neural network either.

It will always return the same output for the same input. There are no training datasets etc.

It's literally just an algorithm that returns an output and returns the next output based on the previous output.

I would have expected some dataset of colors to train a model on and then use that to generate values but there really is no actual AI.

People seem to confuse a clever algorithm with AI.

There's nothing inherently intelligent about what it does. It's all math.

Well, it's doing inference with an already trained neural network. Inference will return the same result always. A training dataset is not needed once a model is trained. Of course, AI sounds better than NN and is shorter than Neural Network. If you want to check the code for the "real" NN to train the model just follow the open issue on GitHub...

There's nothing inherently intelligent about what it does. It's all math.

As any other AI algorithm. In the end, all it's curve fitting...

This is an already trained NN, that's why there are no training dataset or the model does not train...

Is this maybe the difference between AI and ML?

I would expect an AI to be some higher level agent (according to the agent model) that modifies its own code while it does its work.

ML is done independently from the work and if you don't do it again (manually), the model won't change itself.

It's effective, for one. I was surprised how good it looks. Color matching is a lot harder than it seems when you're generating palettes.

"AI" may seem cheesy, but you have to remember that in the future, lots of "AI programming" is just going to become "programming." This is clearly an effective, simple way of solving the problem, and requires no clever or common algorithms.

Also, what the hell is this file? Haha. https://raw.githubusercontent.com/dmarman/dmarman.github.io/...

This is awesome. The model outputs were turned into a single line of javascript which then gets evaluated by multiplying the color against all the weights. That wasn't what I was expecting, and I'm totally stealing this technique.

Also, what the hell is this file? Haha. https://raw.githubusercontent.com/dmarman/dmarman.github.io/....

I may be wrong, but it seems the weights of a trained NN

yep, this line of js was rendered using Brain.js

https://github.com/BrainJS/brain.js#standalone-function

gets evaluated by multiplying the color against all the weights. That wasn't what I was expecting

This is literally just the definition of a 1 layer neural network.

The use of the term AI may generate funding ;-)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.