Please Js Make a random Pleasing color Jquery Library

Please Js is Polite Javascript Color Library.In Please Js make_color function by default will generate and return a random hex string using the golden ratio to ensure that the color will look nice on your screen

You can also pass an options object to make_color and have it do a whole bunch of different things

make_color options:

  • hue: (0-360) By setting the hue, you determine the color.
  • saturation: (0.0-1.0) By setting the saturation, you determine the distance from gray.
  • value: (0.0-1.0) By setting the value, you determine the balance between black and white.
  • base_color: ('the name of an HTML color') Setting a base_color (e.g. 'pink') will create a random color within the HSV range of the chosen color. Please will recognize any of the 146 standard HTML colors, it has a very good memory.
  • greyscale | grayscale: (true/false) Setting either greyscale or grayscale (but we all know which one is correct) to true will cause all of the colors you generate to be within the grey or gray range. This is effectively the same as setting your saturation to 0.
  • golden: (true/false) Setting golden to true randomizes your hue (overrides hue setting) and makes you a spectacular color based on the golden ratio. It's so good, it's the default. Make sure to turn it off if you want to have more control over your generated colors.
  • full_random: (true/false) Setting full_random to true will make Please lose its mind. It will completely randomize the hue, saturation, and value of the colors it makes.
  • colors_returned: (1-infinity) Setting colors_returned to higher than 1 will return an array full of the colors Please has made for you. If you set it to 1, you'll just get the one color! It makes a sort of sense if you think about it.
  • format: ('format string') Setting format string, will change the format of what make_color will return for you. The options are as follows (example is the color black):
    • 'hex' = '#000000'
    • 'rgb' = {r: 0, g: 0,b: 0}
    • 'rgb-string' = 'rgb(0,0,0)'
    • 'hsv' = {h: 0, s: 0, v: 0}

How to Use Please JS ?

Just add below code in your script

Please.make_color(); //ezpz

For more information you can check demo.

Demo Download

About The Massive Technolab

Who We Are

Massive Technolab is a Leading IT services Company in India that expertise in web Development, Web Design and SEO at affordable rates.

Leave a Comment

comments powered by Disqus