Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mm580486/twitter-colour-picker
https://github.com/mm580486/twitter-colour-picker
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mm580486/twitter-colour-picker
- Owner: mm580486
- License: mit
- Created: 2016-04-07T19:19:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-08T14:05:58.000Z (over 8 years ago)
- Last Synced: 2024-11-15T23:46:45.689Z (about 1 month ago)
- Language: Ruby
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Twitter::Colour::Picker
## Installation1.Add gem 'twitter-colour-picker' to your Gemfile.
```ruby
gem 'twitter-colour-picker'
```2.And then execute:
```bash
$ bundle install
```
Or install it yourself as(local):
```bash
$ gem install twitter-colour-picker
```
## Usage| Format | Require |
| --- | --- |
| CSS | *= require colour-picker |
| JS | //= require colour-picker |choice color on controller :
```ruby
#flat colors , source https://flatuicolors.com/
@colors = ["3097d1","1abc9c", "2ecc71","3498db","9b59b6","34495e","f39c12","d35400","c0392b","bdc3c7","7f8c8d","f1c40f"]
```
views:
```html<% @colors.each do |color|%>
<%= color %>
<% end %>```
OR:
```ruby
<%= form.select(:theme_color, options_for_select(@colors, selected: 'user selected'),{},{:class=>"...",:id=>'theme_color',:style=>'display:none;'}) %>
``````javascript
$(document).ready(function(e){
$('#theme_color').colorpicker({
size: 35,
label: 'Theme Color: ',
hide: false
});
});```
## Contributing
For reporting bug, contact me on [twitter](https://twitter.com/mm580486)
## License
Copyright (c) 2015 [Mohammad Mahmoudi](https://twitter.com/mm580486).