Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Jan 3, 2022
2 parents 4341c93 + ae5a70a commit b072c8e
Show file tree
Hide file tree
Showing 36 changed files with 2,364 additions and 623 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.1.0
## 01/03/2022

1. [](#new)
* Updated to `dev-master` of `Mexitek/PHPColors` to get latest functionality
* Added `name_to_hex` Twig function and filter [#4](https://github.com/trilbymedia/grav-plugin-color-tools/issues/4)

# v1.0.2
## 12/23/2021

Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ The **Color Tools** Plugin is an extension for [Grav CMS](http://github.com/getg
* `lighten()`
* `makeGradient()`
* `mix()`
* `nameToHex()`
* `rgbToHex()`
* `rgbToString()`

More information can be found on the GitHub site for the library: https://github.com/mexitek/phpColors

## Installation

Installing the Color Tools plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command, the manual method lets you do so via a zip file, and the admin method lets you do so via the Admin Plugin.
Expand Down Expand Up @@ -60,6 +63,18 @@ A `color()` function is also available:
{{ orange_color.darken(20) }}
```

To use the `name_to_hex` function or twig:

```twig
{{ name_to_hex('chartreuse') }}
or
{{ 'lavender'|name_to_hex }}
```

Full list of color names: https://github.com/mexitek/phpColors/blob/master/src/Mexitek/PHPColors/Color.php#L241

## PHP Usage

To use this class in PHP is also quite simple, an example that mimic above can be seen below:
Expand All @@ -76,4 +91,4 @@ $button_css_class = $button_color->isLight() ? 'text-dark' : 'text-light';

## Credits

The PHP class used was originally developed by Arlo Carreon <http://arlocarreon.com>, then modified by Trilby Media.
The PHP class used was originally developed by Arlo Carreon <http://arlocarreon.com> in [mexitek/phpColors](https://github.com/mexitek/phpColors), then modified by Trilby Media.
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Color Tools
slug: color-tools
type: plugin
version: 1.0.2
version: 1.1.0
description: Color Tools for PHP and Twig
icon: paint-brush
author:
Expand Down
Loading

0 comments on commit b072c8e

Please sign in to comment.