<commit_before>## Color Conversion

This gem provides conversions for colors to and from Hex, RGB, and HSL. 

_This gem is in an extremely experimental state right now_

## Examples

Create a new color:
```ruby
# from hex
color = Color.new("#FFFFFF")
color = Color.new("#FFF")

# from rgb and rgba
color = Color.new(r: 255, g: 255, b: 255)
color = Color.new(r: 255, g: 255, b: 255, a: 0.5)

# from hsl and hsla
color = Color.new(h: 0, s: 100, l: 100)
color = Color.new(h: 0, s: 100, l: 100, a: 0.5)

# from textual color
color = Color.new("white")

# from a css declaration
color = Color.new("rgb(255,255,255)")
color = Color.new("hsl(0,100%,100%)")
```


Convert to RGB
```ruby
Color.new("white").rgb
=> {:r=>255, :g=>255, :b=>255}
```

Convert to Hex
```ruby
Color.new("white").hex
=> "#FFFFFF"
```

Convert to HSL
```ruby
Color.new("white").hsl
=> {:h=>0, :s=>100, :l=>100}
```

Convert to Textual
```ruby
Color.new("#FFFFFF").text
=> "white"
```


## Installation

To install ColorConversion, add the gem to your Gemfile: 

```ruby
gem "color_conversion", "~> 0.0.1"
```

## LICENSE

Copyright (c) 2013 <NAME>

Released under the [MIT License](http://www.opensource.org/licenses/MIT)<commit_msg>update api to use name for named colors instead of text<commit_after>## Color Conversion

This gem provides conversions for colors to and from Hex, RGB, and HSL. 

_This gem is in an extremely experimental state right now_

## Examples

Create a new color:
```ruby
# from hex
color = Color.new("#FFFFFF")
color = Color.new("#FFF")

# from rgb and rgba
color = Color.new(r: 255, g: 255, b: 255)
color = Color.new(r: 255, g: 255, b: 255, a: 0.5)

# from hsl and hsla
color = Color.new(h: 0, s: 100, l: 100)
color = Color.new(h: 0, s: 100, l: 100, a: 0.5)

# from textual color
color = Color.new("white")

# from a css declaration
color = Color.new("rgb(255,255,255)")
color = Color.new("hsl(0,100%,100%)")
```


Convert to RGB
```ruby
Color.new("white").rgb
=> {:r=>255, :g=>255, :b=>255}
```

Convert to Hex
```ruby
Color.new("white").hex
=> "#FFFFFF"
```

Convert to HSL
```ruby
Color.new("white").hsl
=> {:h=>0, :s=>100, :l=>100}
```

Convert to Name
```ruby
Color.new("#FFFFFF").name
=> "white"
```


## Installation

To install ColorConversion, add the gem to your Gemfile: 

```ruby
gem "color_conversion", "~> 0.0.1"
```

## LICENSE

Copyright (c) 2013 <NAME>

Released under the [MIT License](http://www.opensource.org/licenses/MIT)
{'fraction_non_alphanumeric': 0.1887566680344686, 'fraction_numerical': 0.061551087402544113, 'mean_word_length': 4.405764966740577, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1705953', 'n_tokens_mistral': 1088, 'n_tokens_neox': 896, 'n_words': 295}