Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/color_field
  • issue/color_field-3170437
  • issue/color_field-3279248
  • issue/color_field-3262251
  • issue/color_field-3264412
  • issue/color_field-3265958
  • issue/color_field-3272014
  • issue/color_field-3212087
  • issue/color_field-2696505
  • issue/color_field-3264890
  • issue/color_field-3314091
  • issue/color_field-3320202
  • issue/color_field-3331283
  • issue/color_field-3338149
  • issue/color_field-3344907
  • issue/color_field-3340679
  • issue/color_field-3365360
  • issue/color_field-3319249
  • issue/color_field-3379244
  • issue/color_field-3379685
  • issue/color_field-3391938
  • issue/color_field-3415318
  • issue/color_field-3388482
  • issue/color_field-3416883
  • issue/color_field-3179052
  • issue/color_field-3429271
  • issue/color_field-3452293
  • issue/color_field-3452321
  • issue/color_field-3452332
  • issue/color_field-3452386
  • issue/color_field-3452396
  • issue/color_field-3452402
  • issue/color_field-3455029
  • issue/color_field-3372480
  • issue/color_field-3465505
35 results
Show changes
Commits on Source (9)
Showing with 263 additions and 134 deletions
alphavalue
oomphinc
hexhex
HEXHEX
5bcefa
\ No newline at end of file
################
# DrupalCI GitLabCI template
#
# Gitlab-ci.yml to replicate DrupalCI testing for Contrib
#
# With thanks to:
# * The GitLab Acceleration Initiative participants
# * DrupalSpoons
################
################
# Guidelines
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
#
# However, you can modify this template if you have additional needs for your project.
################
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################
include:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
# Require tests to pass.
cspell:
allow_failure: false
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
variables:
# OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_PREVIOUS_MINOR: 1
OPT_IN_TEST_NEXT_MINOR: 1
# OPT_IN_TEST_NEXT_MAJOR: 1
OPT_IN_TEST_MAX_PHP: 1
# Show more log output
_PHPUNIT_EXTRA: --verbose
# Convenient, and we have no secrets.
_SHOW_ENVIRONMENT_VARIABLES: 1
################
# Require CSpell checks to pass.
################
cspell:
allow_failure: false
################
# Require PHPCS checks to pass.
################
phpcs:
allow_failure: false
################
# Require PHPStan checks to pass.
################
phpstan:
allow_failure: false
################
# Require stylelint checks to pass.
################
stylelint:
allow_failure: false
###################################################################################
#
# *
# /(
# ((((,
# /(((((((
# ((((((((((*
# ,(((((((((((((((
# ,(((((((((((((((((((
# ((((((((((((((((((((((((*
# *(((((((((((((((((((((((((((((
# ((((((((((((((((((((((((((((((((((*
# *(((((((((((((((((( .((((((((((((((((((
# ((((((((((((((((((. /(((((((((((((((((*
# /((((((((((((((((( .(((((((((((((((((,
# ,(((((((((((((((((( ((((((((((((((((((
# .(((((((((((((((((((( .(((((((((((((((((
# ((((((((((((((((((((((( ((((((((((((((((/
# (((((((((((((((((((((((((((/ ,(((((((((((((((*
# .((((((((((((((/ /(((((((((((((. ,(((((((((((((((
# *(((((((((((((( ,(((((((((((((/ *((((((((((((((.
# ((((((((((((((, /(((((((((((((. ((((((((((((((,
# (((((((((((((/ ,(((((((((((((* ,(((((((((((((,
# *((((((((((((( .((((((((((((((( ,(((((((((((((
# ((((((((((((/ /((((((((((((((((((. ,((((((((((((/
# ((((((((((((( *(((((((((((((((((((((((* *((((((((((((
# ((((((((((((( ,(((((((((((((..((((((((((((( *((((((((((((
# ((((((((((((, /((((((((((((* /((((((((((((/ ((((((((((((
# ((((((((((((( /((((((((((((/ (((((((((((((* ((((((((((((
# (((((((((((((/ /(((((((((((( ,((((((((((((, *((((((((((((
# (((((((((((((( *(((((((((((/ *((((((((((((. ((((((((((((/
# *((((((((((((((((((((((((((, /(((((((((((((((((((((((((
# ((((((((((((((((((((((((( ((((((((((((((((((((((((,
# .(((((((((((((((((((((((/ ,(((((((((((((((((((((((
# ((((((((((((((((((((((/ ,(((((((((((((((((((((/
# *((((((((((((((((((((( (((((((((((((((((((((,
# ,(((((((((((((((((((((, ((((((((((((((((((((/
# ,(((((((((((((((((((((* /((((((((((((((((((((
# ((((((((((((((((((((((, ,/((((((((((((((((((((,
# ,(((((((((((((((((((((((((((((((((((((((((((((((((((
# .(((((((((((((((((((((((((((((((((((((((((((((
# .((((((((((((((((((((((((((((((((((((,.
# .,(((((((((((((((((((((((((.
#
###################################################################################
# Color Field - Drupal 8
# Color Field
## ABOUT & FEATURES
This module provides an intuitive way to specify and display HTML color values.
For a full description of the module, visit the
[color field](https://www.drupal.org/project/color_field) project page.
Submit bug reports and feature suggestions, or track changes in the
[issue queue](https://www.drupal.org/project/issues/color_field).
## Table of contents
- Requirements
- About & Features
- Road Map
- Installation
- Configuration
- More info
- Maintainers
## Requirements
This module requires no modules outside of Drupal core.
## About & Features
### Formatters
......@@ -29,31 +54,25 @@ native manner. If enabled, opacity is a number field.
provide a user friendly color palette to choose the correct color. This has an
integrated slider for opacity (if opacity is enabled).
## ROAD MAP
## Road Map
1) Make this module a base that could be used by any color picker.
2) include http://www.eyecon.ro/colorpicker/
3) include http://www.dematte.at/colorPicker/
4) include http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/
## INSTALLATION
Install as you would normally install a contributed Drupal module. See also
[Core Docs](https://www.drupal.org/docs/8/extending-drupal-8/installing-modules)
## Installation
### DEPENDENCIES
There are JavaScript libraries required for a couple of the field widgets. If
you are not actively using those field widgets, you can skip their installation
if desired.
Install as you would normally install a contributed Drupal module. For further information, see [Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules).
#### COMPOSER
If you installed color field via [Composer](https://getcomposer.org), the
packages will have been suggested but not automatically installed. If you have
Asset Packagist already configured - as most Commerce users will - skip to just
requiring the desired package(s).
```bash
composer require bower-asset/jquery-simple-color bower-asset/spectrum
```
```
Otherwise, to install them you will need to add
[Asset Packagist](https://asset-packagist.org) to your composer.json and
......@@ -94,38 +113,14 @@ composer require oomphinc/composer-installers-extender
composer require bower-asset/jquery-simple-color bower-asset/spectrum
```
#### MANUAL
If you are not using Composer, you will need to manually install them.
## Configuration
- [jQuery Simple Color](https://github.com/recurser/jquery-simple-color)
copy to `/libraries/jquery-simple-color` so that `jquery.simple-color.min.js`
is in that folder. Required for the Color Grid widget.
- [Spectrum](https://github.com/bgrins/spectrum) copy to `/libraries/spectrum`
so that `spectrum.js` exists in that folder. Required for the Spectrum widget.
1. Enable the module at Administration > Extend.
1. Add a field of the "Color" type to any content type, vocabulary, or other
bundle that could leverage the functionality of this module.
1. Configure the form display and display options that best suit your needs.
1. Profit!
## USAGE
Field
1. Add the field to an node/entity
2. Select the 'Color Field' field type
3. Select the 'Color' widget you want
## DEVELOPMENT
To ease matching Drupal code standards, development dependencies are configured
to use a pre-commit hook. Install composer dev dependencies and PHPCS will be
automatically run if php is in your path.
## CREDIT
Original Creator: [targoo](https://www.drupal.org/u/targoo).
Maintainers:
- [targoo](https://www.drupal.org/u/targoo)
- [Nick Wilde](https://www.drupal.org/u/nickwilde)
Original development sponsored by Marique Calcus and written by Calcus David.
For professional support and development services contact targoo@gmail.com.
## More info
......@@ -134,3 +129,12 @@ https://github.com/mikeemoo/ColorJizz-PHP
http://www.colorhexa.com/ff0000
https://github.com/PrimalPHP/Color/blob/master/lib/Primal/Color/Parser.php
https://github.com/matthewbaggett/php-color/blob/master/Color.php
## Maintainers (optional)
[//]: # cSpell:disable
[//]: # Do not add maintainers to cspell-project-words file
- david calcus - [targoo](https://www.drupal.org/u/targoo)
- Nick Dickinson-Wilde - [NickDickinsonWilde](https://www.drupal.org/u/NickDickinsonWilde)
- Martin Anderson-Clutz - [mandclu](https://www.drupal.org/u/mandclu)
name: Color Field
type: module
description: 'Provides a color field type to store the color value and opacity.'
core_version_requirement: ^9 || ^10
core_version_requirement: ^9 || ^10 || ^11
package: Field types
dependencies:
- drupal:field
......
......@@ -5,7 +5,7 @@
* Install, update and uninstall functions for the Color Fields module.
*/
declare(strict_types = 1);
declare(strict_types=1);
/**
* If the JavaScript Libraries don't exist, show a warning on the status page.
......
......@@ -5,7 +5,7 @@
* A color field with a custom color picker using the Field Types API.
*/
declare(strict_types = 1);
declare(strict_types=1);
use Drupal\color_field\ColorHex;
use Drupal\Core\Field\FieldItemListInterface;
......@@ -153,7 +153,7 @@ function color_field_tokens(string $type, array $tokens, array $data, array $opt
if ($type === 'color_field' && !empty($data['color_field'])) {
/** @var \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType $color_field */
$color_field = $data['color_field'];
$color_hex = new ColorHex($color_field->color, $color_field->opacity);
$color_hex = new ColorHex($color_field->color, is_null($color_field->opacity) ? NULL : (float) $color_field->opacity);
foreach ($tokens as $name => $original) {
switch ($name) {
......
{
"name": "drupal/color_field",
"require": {
"drupal/core": "^9 || ^10"
"drupal/core": "^9 || ^10 || ^11"
},
"require-dev": {
"drupal/feeds": "",
"drupal/feeds": "^3.0@beta",
"drupal/token": "~1.3",
"drupal/core-recommended": "^9 || ^10"
},
......@@ -13,7 +13,6 @@
"bower-asset/spectrum": "^1.8: Provides JavaScript library necessary for Spectrum widget."
},
"type": "drupal-module",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
......
......@@ -92,6 +92,14 @@ field.widget.settings.color_field_widget_default:
type: label
label: 'Opacity placeholder'
field.widget.settings.color_field_widget_html5:
type: mapping
label: 'Color HTML5 widget settings'
mapping:
show_extra:
type: boolean
label: 'Show extra'
field.widget.settings.color_field_widget_box:
type: mapping
label: 'Color boxes format settings'
......
#drupal-off-canvas button.color_field_widget_box__square,
.color_field_widget_box__square {
border: 1px solid #000;
box-shadow: 0 0 1px #000;
display: inline-block;
box-sizing: border-box;
width: 16px;
height: 16px;
margin: 2px;
width: 16px;
display: inline-block;
border: 1px solid #000;
box-shadow: 0 0 1px #000;
}
#drupal-off-canvas button.color_field_widget_box__square.active,
#drupal-off-canvas button.color_field_widget_box__square:hover,
.color_field_widget_box__square.active,
.color_field_widget_box__square:hover {
height: 32px;
width: 32px;
height: 32px;
}
#drupal-off-canvas button.color_field_widget_box__square--transparent,
.color_field_widget_box__square--transparent {
background-image: url("../images/transparent_box16.gif");
background-repeat: no-repeat;
border: 1px solid #000;
box-shadow: 0 0 1px #000;
box-sizing: border-box;
width: 16px;
height: 16px;
margin: 2px;
width: 16px;
border: 1px solid #000;
background-image: url("../images/transparent_box16.gif");
background-repeat: no-repeat;
box-shadow: 0 0 1px #000;
}
#drupal-off-canvas button.color_field_widget_box__square--transparent.active,
#drupal-off-canvas button.color_field_widget_box__square--transparent:hover,
.color_field_widget_box__square--transparent.active,
.color_field_widget_box__square--transparent:hover {
background-image: url(../images/transparent_box32.gif);
height: 32px;
width: 32px;
height: 32px;
background-image: url(../images/transparent_box32.gif);
}
#drupal-off-canvas button.color_field_widget_box__color.required,
.color_field_widget_box__color.required {
display: block !important;
overflow: hidden;
width: 0;
height: 0;
min-height: 0;
padding: 0;
border: none;
overflow: hidden;
min-height: 0;
}
......@@ -5,10 +5,10 @@
.js-color-field-widget-grid__color.required {
display: block !important;
overflow: hidden;
width: 0;
height: 0;
min-height: 0;
padding: 0;
border: none;
overflow: hidden;
min-height: 0;
}
.js-color-field-widget-spectrum__color.required,
.js-color-field-widget-spectrum__opacity.required {
display: block !important;
overflow: hidden;
width: 0;
height: 0;
min-height: 0;
padding: 0;
border: none;
overflow: hidden;
min-height: 0;
}
build:
environment:
startcontainers:
runcontainers:
create_db:
dbcreate:
codebase:
assemble_codebase:
checkout_core:
checkout.contrib:
fetch:
patch:
composer.core_install:
gather_dependencies:
update_build:
yarn_install:
start_phantomjs:
assessment:
validate_codebase:
phplint:
container_composer:
csslint:
eslint:
phpcs:
testing:
container_command:
commands:
- cd ${SOURCE_DIR}
- sudo -u www-data composer config repositories.asset {"composer","https://asset-packagist.org"}
- sudo -u www-data composer config --no-plugins allow-plugins.oomphinc/composer-installers-extender true
- sudo -u www-data composer config extra.installer-types.0 "npm-asset"
- sudo -u www-data composer config extra.installer-types.1 "bower-asset"
- sudo -u www-data composer config extra.installer-paths.libraries\/\{\$name\} "[type:bower-asset]"
- sudo -u www-data sed -i 's/"\[type:bower-asset\]"/\["type:bower-asset"\]/' composer.json
- sudo -u www-data composer require "oomphinc/composer-installers-extender:^2.0" "bower-asset/spectrum:^1.8" "bower-asset/jquery-simple-color:^v1.2.2"
run_tests.standard:
types: 'Simpletest,PHPUnit-Unit,PHPUnit-Kernel,PHPUnit-Functional'
run_tests.js:
concurrency: 1
types: 'PHPUnit-FunctionalJavascript'
nightwatchjs:
......@@ -39,13 +39,13 @@
cancelText: spectrum_settings.cancel_text,
appendTo: $element_color.parent(),
change: function (tinycolor) {
change: function (truecolor) {
let hexColor = '';
let opacity = '';
if (tinycolor) {
hexColor = tinycolor.toHexString();
opacity = Math.round((tinycolor._roundA + Number.EPSILON) * 100) / 100;
if (truecolor) {
hexColor = truecolor.toHexString();
opacity = Math.round((truecolor._roundA + Number.EPSILON) * 100) / 100;
}
$element_color.val(hexColor);
......@@ -56,11 +56,11 @@
// Set alpha value on load.
if (!!spectrum_settings.show_alpha) {
const tinycolor = $element_color.spectrum("get");
const truecolor = $element_color.spectrum("get");
const alpha = $element_opacity.val();
if (alpha > 0) {
tinycolor.setAlpha(alpha);
$element_color.spectrum("set", tinycolor);
truecolor.setAlpha(alpha);
$element_color.spectrum("set", truecolor);
}
}
......
logo.png

19.2 KiB

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(42.6667,0,0,42.6667,0.0497685,0)">
<path d="M0.702,6C0.702,3.093 3.093,0.702 6,0.702C8.907,0.702 11.298,3.093 11.298,6C11.298,8.907 8.907,11.298 6,11.298C3.093,11.298 0.702,8.907 0.702,6M3.025,2.573C3.766,1.927 4.699,1.54 5.68,1.472L5.68,5.226L3.025,2.573ZM2.573,3.025C1.927,3.766 1.54,4.699 1.472,5.68L5.226,5.68L2.573,3.025ZM5.227,6.32L1.473,6.32C1.541,7.301 1.927,8.234 2.573,8.975L5.227,6.32ZM3.025,9.427C3.766,10.073 4.699,10.46 5.68,10.528L5.68,6.773L3.025,9.427ZM6.32,6.773L6.32,10.527C7.301,10.459 8.233,10.073 8.974,9.427L6.32,6.773ZM9.427,8.974C10.073,8.233 10.46,7.301 10.528,6.32L6.773,6.32L9.427,8.974ZM6.773,5.68L10.527,5.68C10.459,4.699 10.073,3.766 9.427,3.025L6.773,5.68ZM8.975,2.573C8.234,1.927 7.301,1.54 6.32,1.472L6.32,5.226L8.975,2.573Z"/>
</g>
<g transform="matrix(42.6667,0,0,42.6667,0.0497685,0)">
<path d="M0.702,6C0.702,3.093 3.093,0.702 6,0.702C8.907,0.702 11.298,3.093 11.298,6C11.298,8.907 8.907,11.298 6,11.298C3.093,11.298 0.702,8.907 0.702,6"/>
</g>
<g transform="matrix(42.6667,0,0,42.6667,0.0497685,0)">
<path d="M3.025,2.573C3.766,1.927 4.699,1.54 5.68,1.472L5.68,5.226L3.025,2.573Z" style="fill:rgb(242,94,13);"/>
<path d="M2.573,3.025C1.927,3.766 1.54,4.699 1.472,5.68L5.226,5.68L2.573,3.025Z" style="fill:rgb(242,175,13);"/>
<path d="M5.227,6.32L1.473,6.32C1.541,7.301 1.927,8.234 2.573,8.975L5.227,6.32Z" style="fill:rgb(229,242,13);"/>
<path d="M3.025,9.427C3.766,10.073 4.699,10.46 5.68,10.528L5.68,6.773L3.025,9.427Z" style="fill:rgb(148,242,13);"/>
<path d="M6.32,6.773L6.32,10.527C7.301,10.459 8.233,10.073 8.974,9.427L6.32,6.773Z" style="fill:rgb(13,242,121);"/>
<path d="M9.427,8.974C10.073,8.233 10.46,7.301 10.528,6.32L6.773,6.32L9.427,8.974Z" style="fill:rgb(13,40,242);"/>
<path d="M6.773,5.68L10.527,5.68C10.459,4.699 10.073,3.766 9.427,3.025L6.773,5.68Z" style="fill:rgb(147,13,242);"/>
<path d="M8.975,2.573C8.234,1.927 7.301,1.54 6.32,1.472L6.32,5.226L8.975,2.573Z" style="fill:rgb(242,13,13);"/>
</g>
</svg>
<?php
declare(strict_types = 1);
declare(strict_types=1);
namespace Drupal\color_field;
......@@ -32,6 +32,7 @@ abstract class ColorBase implements ColorInterface {
* @var string[]
*/
public static array $namedColors = [
// cspell:disable
"aliceblue" => "f0f8ff",
"antiquewhite" => "faebd7",
"aqua" => "00ffff",
......@@ -175,6 +176,7 @@ abstract class ColorBase implements ColorInterface {
"whitesmoke" => "f5f5f5",
"yellow" => "ffff00",
"yellowgreen" => "9acd32",
// cspell:enable
];
/**
......@@ -182,12 +184,12 @@ abstract class ColorBase implements ColorInterface {
*
* @var float
*/
protected float $opacity;
protected float|null $opacity;
/**
* Get the opacity.
*
* @return float
* @return float|null
* The opacity value between 0 and 1.
*/
public function getOpacity(): float {
......@@ -197,7 +199,7 @@ abstract class ColorBase implements ColorInterface {
/**
* Set the opacity.
*/
public function setOpacity(float $opacity): void {
public function setOpacity(?float $opacity): void {
$this->opacity = $opacity;
}
......
<?php
declare(strict_types = 1);
declare(strict_types=1);
namespace Drupal\color_field;
......@@ -39,10 +39,10 @@ class ColorCMY extends ColorBase {
* The magenta.
* @param int $yellow
* The yellow.
* @param float $opacity
* @param float|null $opacity
* The opacity.
*/
public function __construct(int $cyan, int $magenta, int $yellow, float $opacity) {
public function __construct(int $cyan, int $magenta, int $yellow, ?float $opacity) {
$this->cyan = $cyan;
$this->magenta = $magenta;
$this->yellow = $yellow;
......
<?php
declare(strict_types = 1);
declare(strict_types=1);
namespace Drupal\color_field;
......@@ -27,10 +27,10 @@ class ColorCMYK extends ColorCMY {
* The yellow.
* @param int $key
* The key (black).
* @param float $opacity
* @param float|null $opacity
* The opacity.
*/
public function __construct(int $cyan, int $magenta, int $yellow, int $key, float $opacity) {
public function __construct(int $cyan, int $magenta, int $yellow, int $key, ?float $opacity) {
parent::__construct($cyan, $magenta, $yellow, $opacity);
$this->key = $key;
}
......
<?php
declare(strict_types = 1);
declare(strict_types=1);
namespace Drupal\color_field;
......@@ -39,12 +39,12 @@ class ColorHSL extends ColorBase {
* The sat (0-100)
* @param int $lum
* The lum (0-100)
* @param float $opacity
* @param float|null $opacity
* The opacity.
*
* @throws \Exception
*/
public function __construct(int $hue, int $sat, int $lum, float $opacity) {
public function __construct(int $hue, int $sat, int $lum, ?float $opacity) {
if ($hue < 0 || $hue > 360) {
throw new \Exception("Invalid hue: $hue");
}
......
<?php
declare(strict_types = 1);
declare(strict_types=1);
namespace Drupal\color_field;
......@@ -21,13 +21,13 @@ class ColorHex extends ColorBase {
*
* @param string $color
* The string hex value (i.e. "FFFFFF").
* @param string $opacity
* @param float|null $opacity
* The opacity value.
*
* @throws \Exception
* If the color doesn't appear to be a valid hex value.
*/
public function __construct(string $color, ?string $opacity) {
public function __construct(string $color, ?float $opacity) {
$color = trim(strtolower($color));
if (str_starts_with($color, '#')) {
......@@ -43,10 +43,8 @@ class ColorHex extends ColorBase {
}
$this->color = hexdec($color);
$opacity = $opacity ?? '1';
$opacity = $opacity ?? 1.0;
$this->setOpacity((float) $opacity);
return $this;
}
/**
......