Recommend this page to a friend! |
Classes of Muhammad Usman | PHP CRUD 360 Form Generator | crud360/js/colorpicker/README.md | Download |
|
DownloadPick-a-Color: a jQuery color picker for Twitter BootstrapFor a documentation-reading experience that includes rainbow gradients and live examples, check out the official docs at http://lauren.github.io/pick-a-color. There are some great color picker plugins out there, but most cater to the needs of techies and designers, providing complicated controls to access every color imaginable. Pick-a-Color is designed to be easy for anyone to use. The interface is based on Twitter Bootstrap styles so it looks lovely with the styles of almost any site. FeaturesFor your site's usersFlexible text entry: Accepts HEX, RGB, HSL, HSV, HSVA, and names, thanks to Brian Grinstead's amazing Tiny Color library. Saved colors: Saves up to 16 recently used colors. Colors are stored in localStorage or cookies. Advanced: Advanced tab lets users modify hue, saturation, and lightness to make any color their hearts desire. Basic color palette: Easy-to-use preset colors that can be lightened and darkened. Chunky mobile styles: Dragging is easy, even on a touch device. For youTested: Tested in Chrome (Mac/PC/iOS), Safari (Mac/iOS), IE 8+, Firefox (Mac/PC), and Opera (Mac/PC). No conflicts: Anonymous JavasScript function and namespaced CSS won't mess up your code. Simple initialization: As little as one line of HTML and one line of JavaScript. Done: You didn't have to write your own color picker. 'Nuff said. What? Why? Who?I'm Lauren. I originally wrote Pick-a-Color for my friends at Broadstreet Ads because they needed a color picker that was easy for people at online publishing companies to use. If you have any bugs to report in Pick-a-Color, let me know by making a ticket here: https://github.com/lauren/pick-a-color/issues/new Pick-a-Color is available under the MIT License: https://github.com/lauren/pick-a-color/blob/master/LICENSE OK! Let's do this color picking thing! How to UseBower
Compiled CSS For Use With Default Bootstrap Settings1) Download the required files: https://github.com/lauren/pick-a-color/archive/master.zip. Add the CSS and JS from the latest release in /build to your CSS and JS folders and include them in your document as follows: For Bootstrap 3, use Pick-a-Color 1.2.3:In the
Before the ending
For Bootstrap 2, use Pick-a-Color 1.1.8:In the
Before the ending
2) Add this to your HTML wherever you want a Pick-A-Color. Replace
For instance, yours might look like this:
Notes: i) If you don't provide a ii) You can change the class of your 3) Add this to your JavaScript somewhere after the DOM is ready. Make sure the class selector matches the class of your div:
4) To optimize IE and mobile support, I recommend adding these tags to your
Ta-da! You have a color picker! You might even have several! Source LESS for Use with Customized Bootstrap1) Download the source: https://github.com/lauren/pick-a-color/archive/master.zip. 2) Add 3) Update the import statements in lines 7 and 8 of
To:
4) Compile 5) Return to Step 1 of instructions for use of the compiled CSS. Sample HTMLHere's an example of how a simple HTML page using Pick-a-Color might look:
EventsEach time a user chooses a new color (or enters one manually), there will be a Here's sample code for accessing the new color from a Pick-a-Color initialized with the name
OptionsIf you'd like to change any of my default options, you can specify your preferred settings like this:
showSpectrumSpecifies whether or not there is a spectrum next to each basic color allowing users to lighten and darken it. showSavedColorsSpecifies whether or not there is a tab called "Saved Colors" that keeps track of the last 16 colors a user customized. showAdvancedSpecifies whether or not there is a tab called "Advanced" that allows users to modify hue, lightness, and saturation to make any color their hearts desire. saveColorsPerElement (for showSavedColors only)If set to If set to I recommend setting this to fadeMenuToggleSpecifies whether or not the dropdown menu should fade in and out when it's opened and closed. This setting is overridden for mobile devices, in which Pick-a-Color never ever ever uses a fade because WOW they look terrible in mobile browsers. showBasicColorsSpecifies whether or not the dropdown should show a list of basic colors that the user can select from. Thanks to Ryan Johnson for adding this feature! showHexInputSpecifies whether or not to show the hex text input. If false the input has an input type of 'hidden'. Thanks to Ryan Johnson for adding this feature! allowBlankSpecifies whether or not the field can be left blank. Use this if the color input is not a required field. Thanks to San for adding this feature! inlineDropdownSpecifies whether the dropdown should be shown below the input field (instead of the default, to the right) on desktop browsers. Tested BrowsersI've tested Pick-a-Color in these browsers:
Minor issues in these browsers are documented here: https://github.com/lauren/pick-a-color/issues The only major platform I haven't been able to test yet is Android. I'm working on it. Notes on IE SupportI highly recommend using the X-UA-COMPATIBLE tag in your html
Notes on Mobile SupportYou must use a viewport tag in your html
ContributingI ? pull requests. Here's how to contribute:
|