Code Monkey home page Code Monkey logo

Comments (12)

Fooidge avatar Fooidge commented on July 21, 2024

Do you mean a seed color? Or seeding the randomization?

from pleasejs.

MaciekBaron avatar MaciekBaron commented on July 21, 2024

Seeding the randomisation; this could be done by implementing something like a RC4 pseudo-random number generation (here is an implementation of it I've done for a different project).

What I have in mind is the ability to generate a set of colours based on selected parameters and a seed (e.g. a string), which would always return the same colour for the same string.

from pleasejs.

Fooidge avatar Fooidge commented on July 21, 2024

Can you give me an example of a compelling use for this?

from pleasejs.

MaciekBaron avatar MaciekBaron commented on July 21, 2024

For instance, you can generate a set of colours based on a nickname etc.. It's useful for situations when you want to have the same colour scheme for a seed (e.g. nickname) but you don't want to store the generated colours anywhere. All you need to do is read the nickname and retrieve the set of colours you have generated.

Another example, in procedurally generated games you might want to generate some colour schemes. The procedural generation could be seed based, and you always want to have the same output/result for the same seed.

from pleasejs.

Fooidge avatar Fooidge commented on July 21, 2024

Give it a whack, seems cool. My main concern is the size to benefit ratio of this change.

from pleasejs.

MaciekBaron avatar MaciekBaron commented on July 21, 2024

It will be just a few lines of modifications to the existing code plus the implementation of RC4, which is little over 40 lines and can be improved. I'll give it a go this weekend.

from pleasejs.

NadyaNayme avatar NadyaNayme commented on July 21, 2024

@Fooidge
This actually sounds pretty cool and would add a layer of sociability between users of PleaseJS.

For example, I could tweet:
"Check out 'Fudge'! It's absolutely delicious! #PleaseJS"

[Random passerby comment]

from pleasejs.

Fooidge avatar Fooidge commented on July 21, 2024

Except 'Fudge' might be magenta. But I am sort of geeking already at the thought of having a hashtag for this.

from pleasejs.

NadyaNayme avatar NadyaNayme commented on July 21, 2024

I see no harm in Fudge being magenta.
Just hope Fooidge isn't pink? ;)

from pleasejs.

alexhulbert avatar alexhulbert commented on July 21, 2024

👍 Amazing library, by the way. This is by far the best color generation module I've ever seen.

from pleasejs.

Fooidge avatar Fooidge commented on July 21, 2024

No. Was gonna look at it tomorrow.

Jordan Checkman

On Sep 20, 2014, at 4:01 PM, Taconut [email protected] wrote:

Has this enhancement been abandoned?


Reply to this email directly or view it on GitHub.

from pleasejs.

Fooidge avatar Fooidge commented on July 21, 2024

Added in 1482cad

from pleasejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.