Skip to content

Commit

Permalink
Version 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronef committed Jan 19, 2024
2 parents d5a1cd9 + 027eb26 commit 8c01863
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 56 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# (MODX)EvolutionCMS.snippets.ddColorTools changelog


## Version 3.2 (2023-03-10)
* \+ Parameters → `inputColor`: Supports values with alpha-channel.
* \+ `offset_a`: The new parameter. Allows you to modify alpha-channel.
* \+ `result_tpl` → Placeholders → `[+ddA+]`: The new placeholder.
* \* `\ddTools::getTpl` is used instead of `$modx->getTpl`.
* \* Attention! (MODX)EvolutionCMS.libraries.ddTools >= 0.60 is required.


## Version 3.1 (2023-03-10)
* \* Attention! (MODX)EvolutionCMS.libraries.ddTools >= 0.57 is required.
* \* Attention! (MODX)EvolutionCMS.snippets.ddGetDocumentField >= 2.11.1 is required.
Expand Down Expand Up @@ -53,5 +61,5 @@
* \+ Initial commit.


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
<style>ul{list-style:none;}</style>
10 changes: 9 additions & 1 deletion CHANGELOG_ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# (MODX)EvolutionCMS.snippets.ddColorTools changelog


## Версия 3.2 (2023-03-10)
* \+ Parameters → `inputColor`: Supports values with alpha-channel.
* \+ `offset_a`: The new parameter. Allows you to modify alpha-channel.
* \+ `result_tpl` → Placeholders → `[+ddA+]`: The new placeholder.
* \* `\ddTools::getTpl` is used instead of `$modx->getTpl`.
* \* Attention! (MODX)EvolutionCMS.libraries.ddTools >= 0.60 is required.


## Версия 3.1 (2023-03-10)
* \* Внимание! Требуется (MODX)EvolutionCMS.libraries.ddTools >= 0.57.
* \* Внимание! Требуется (MODX)EvolutionCMS.snippets.ddGetDocumentField >= 2.11.1.
Expand Down Expand Up @@ -53,5 +61,5 @@
* \+ Начальный кэммит.


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
<style>ul{list-style:none;}</style>
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Converts the color to match the offset in tone, brightness, or saturation.
## Requires

* PHP >= 5.6
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.biz/modx/ddtools) >= 0.57
* [(MODX)EvolutionCMS.snippets.ddGetDocumentField](https://code.divandesign.biz/modx/ddgetdocumentfield) >= 2.11.1
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.ru/modx/ddtools) >= 0.60
* [(MODX)EvolutionCMS.snippets.ddGetDocumentField](https://code.divandesign.ru/modx/ddgetdocumentfield) >= 2.11.1


## Installation
Expand All @@ -19,7 +19,7 @@ Converts the color to match the offset in tone, brightness, or saturation.
#### 1. Elements → Snippets: Create a new snippet with the following data

1. Snippet name: `ddColorTools`.
2. Description: `<b>3.1</b> Converts the color to match the offset in tone, brightness, or saturation.`.
2. Description: `<b>3.2</b> Converts the color to match the offset in tone, brightness, or saturation.`.
3. Category: `Core`.
4. Parse DocBlock: `no`.
5. Snippet code (php): Insert content of the `ddColorTools_snippet.php` file from the archive.
Expand Down Expand Up @@ -59,15 +59,19 @@ require_once(
### Input color

* `inputColor`
* Desctription: Input color as HEX, HSL or HSB/HSV.
* Desctription: Input color as HEX, HSL or HSB/HSV, with or without alpha-channel.
Case-insensitive.
Valid format examples:
* `ffffff`
* `#FFFFFF`
* `#FFFFFFFF`
* `hsl(0, 0%, 100%)`
* `hsla(0, 0%, 100%)`
* `HSL(0, 0, 100)`
* `hsb(0, 0%, 100%)`
* `hsba(0, 0%, 100%)`
* `hsv(0, 0%, 100%)`
* `hsva(0, 0%, 100%)`
* `hsb(0, 0, 100)`
* `hsv(0, 0, 100)`
* Valid values: `string`
Expand Down Expand Up @@ -124,6 +128,16 @@ All parameters can contain the following special operators:
* Desctription: Offset of the lightness in persents (`[-100; +100]`).
* Valid values: `string`
* **Required**

* `offset_a`
* Desctription: Operations of the alpha-channel offset separated by commas.
* Valid values: `stringCommaSeparated`
* Default value: `'+0'`

* `offset_a[i]`
* Desctription: Offset of the alpha-channel in persents (`[-100; +100]`).
* Valid values: `string`
* **Required**


### Output
Expand All @@ -144,6 +158,7 @@ All parameters can contain the following special operators:
* `[+ddH+]` — hue
* `[+ddS+]` — saturation
* `[+ddL+]` — lightness
* `[+ddA+]` — alpha-channel
* `[+ddIsDark+]` — is color dark (`0` || `1`)?
* Valid values:
* `stringChunkName`
Expand Down Expand Up @@ -217,10 +232,10 @@ require_once(

## Links

* [Home page](https://code.divandesign.biz/modx/ddcolortools)
* [Home page](https://code.divandesign.ru/modx/ddcolortools)
* [Telegram chat](https://t.me/dd_code)
* [Packagist](https://packagist.org/packages/dd/evolutioncms-snippets-ddcolortools)
* [GitHub](https://github.com/DivanDesign/EvolutionCMS.snippets.ddColorTools)


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
25 changes: 20 additions & 5 deletions README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
## Использует

* PHP >= 5.6
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.biz/modx/ddtools) >= 0.57
* [(MODX)EvolutionCMS.snippets.ddGetDocumentField](https://code.divandesign.biz/modx/ddgetdocumentfield) >= 2.11.1
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.ru/modx/ddtools) >= 0.60
* [(MODX)EvolutionCMS.snippets.ddGetDocumentField](https://code.divandesign.ru/modx/ddgetdocumentfield) >= 2.11.1


## Установка
Expand All @@ -19,7 +19,7 @@
#### 1. Элементы → Сниппеты: Создайте новый сниппет со следующими параметрами

1. Название сниппета: `ddColorTools`.
2. Описание: `<b>3.1</b> Преобразует цвет в соответствии со смещением по тону, яркости или насыщенности.`.
2. Описание: `<b>3.2</b> Преобразует цвет в соответствии со смещением по тону, яркости или насыщенности.`.
3. Категория: `Core`.
4. Анализировать DocBlock: `no`.
5. Код сниппета (php): Вставьте содержимое файла `ddColorTools_snippet.php` из архива.
Expand Down Expand Up @@ -59,15 +59,19 @@ require_once(
### Исходный цвет

* `inputColor`
* Описание: Исходный цвет в HEX, HSL или HSB/HSV.
* Описание: Исходный цвет в HEX, HSL или HSB/HSV, с альфа-каналом или без.
Значение регистронезависимо.
Примеры валидных значений:
* `ffffff`
* `#FFFFFF`
* `#FFFFFFFF`
* `hsl(0, 0%, 100%)`
* `hsla(0, 0%, 100%)`
* `HSL(0, 0, 100)`
* `hsb(0, 0%, 100%)`
* `hsba(0, 0%, 100%)`
* `hsv(0, 0%, 100%)`
* `hsva(0, 0%, 100%)`
* `hsb(0, 0, 100)`
* `hsv(0, 0, 100)`
* Допустимые значения: `string`
Expand Down Expand Up @@ -124,6 +128,16 @@ require_once(
* Описание: Смещение яркости в процентах (`[-100; +100]`).
* Допустимые значения: `string`
* **Обязателен**

* `offset_a`
* Описание: Операции смещения альфа-канала через запятую.
* Допустимые значения: `stringCommaSeparated`
* Значение по умолчанию: `'+0'`

* `offset_a[i]`
* Описание: Смещение альфа-канала в процентах (`[-100; +100]`).
* Допустимые значения: `string`
* **Обязателен**


### Вывод результата
Expand All @@ -144,6 +158,7 @@ require_once(
* `[+ddH+]` — цветовой тон
* `[+ddS+]` — насыщенность
* `[+ddL+]` — яркость
* `[+ddA+]` — альфа-канал
* `[+ddIsDark+]` — является ли цвет тёмным (`0` || `1`)
* Допустимые значения:
* `stringChunkName`
Expand Down Expand Up @@ -223,4 +238,4 @@ require_once(
* [GitHub](https://github.com/DivanDesign/EvolutionCMS.snippets.ddColorTools)


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
12 changes: 3 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dd/evolutioncms-snippets-ddcolortools",
"type": "modxevo-snippet",
"version": "3.1.0",
"version": "3.2.0",
"description": "Converts the color to match the offset in tone, brightness, or saturation.",
"keywords": [
"modx",
Expand All @@ -22,17 +22,11 @@
"rgb to hsl",
"hsl to rgb"
],
"homepage": "https://code.divandesign.biz/modx/ddstartsnippet",
"homepage": "https://code.divandesign.ru/modx/ddstartsnippet",
"support": {
"chat": "https://t.me/dd_code"
},
"authors": [
{
"name": "DD Group",
"email": "[email protected]",
"homepage": "https://code.divandesign.biz",
"role": "Owner"
},
{
"name": "Ilyas Ronef",
"email": "[email protected]",
Expand All @@ -47,7 +41,7 @@
],
"require": {
"php": ">=5.6.0",
"dd/evolutioncms-libraries-ddtools": ">=0.57.0",
"dd/evolutioncms-libraries-ddtools": ">=0.60.0",
"dd/evolutioncms-snippets-ddgetdocumentfield": ">=2.11.1"
}
}
6 changes: 3 additions & 3 deletions ddColorTools_snippet.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* ddColorTools
* @version 3.1 (2023-03-10)
* @version 3.2 (2023-03-10)
*
* @see README.md
*
* @link https://code.divandesign.biz/modx/ddcolortools
* @link https://code.divandesign.ru/modx/ddcolortools
*
* @copyright 2011–2023 DD Group {@link https://DivanDesign.biz }
* @copyright 2011–2024 Ronef {@link https://Ronef.ru }
*/

//Include (MODX)EvolutionCMS.libraries.ddTools
Expand Down
Loading

0 comments on commit 8c01863

Please sign in to comment.