Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mm580486/twitter-colour-picker


https://github.com/mm580486/twitter-colour-picker

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Twitter::Colour::Picker




## Installation

1.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).