消える飛行機雲 僕たちは見送った 眩しくて逃げた いつだって弱くて あの日から変わらず いつまでも変わらずに いられなかったこと 悔しくて指を離す あの鳥は まだ うまく飛べないけど いつかは 風を切って知る 届かない場所が まだ遠くにある 願いだけ秘めて 見つめてる 子供たちは 夏の線路 歩く 吹く風に素足をさらして 遠くには幼かった日びを 両手には 飛び立つ希望を 消える飛行機雲 追いかけて 追いかけて この丘を越えた あの日から変わらず いつまでも 真っ直ぐに 僕たちはあるように わたつみのような 強さを守れるよ きっと ���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC ‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*! [](https://supportukrainenow.org) # A little library to handle color conversions and comparisons [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/color.svg?style=flat-square)](https://packagist.org/packages/spatie/color) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) [![Build Status](https://img.shields.io/travis/spatie/color/master.svg?style=flat-square)](https://travis-ci.org/spatie/color) [![Quality Score](https://img.shields.io/scrutinizer/g/spatie/color.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/color) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/color.svg?style=flat-square)](https://packagist.org/packages/spatie/color) ![Tests](https://github.com/spatie/color/workflows/Tests/badge.svg) A little library to handle color conversions and comparisons. Currently supports rgb, rgba, hex, hsl, hsla, CIELab, and xyz color formats as well as CIE76, CIE94, and CIEDE2000 color comparison algorithms. ```php $rgb = Rgb::fromString('rgb(55,155,255)'); echo $rgb->red(); // 55 echo $rgb->green(); // 155 echo $rgb->blue(); // 255 echo $rgb; // rgb(55,155,255) $rgba = $rgb->toRgba(); // `Spatie\Color\Rgba` $rgba->alpha(); // 1 echo $rgba; // rgba(55,155,255,1) $hex = $rgb->toHex(); // `Spatie\Color\Hex` $rgba->alpha(); // ff echo $hex; // #379bff $cmyk = $rgb->toCmyk(); // `Spatie\Color\Cmyk` echo $cmyk; // cmyk(78,39,0,0) $hsl = $rgb->toHsl(); // `Spatie\Color\Hsl` echo $hsl; // hsl(210,100%,100%) $hsb = $rgb->toHsb(); // `Spatie\Color\Hsb` echo $hsb; // hsl(210,78.4%,100%) $lab = $rgb->toCIELab(); echo $lab; // CIELab(62.91,5.34,-57.73) $xyz = $rgb->toXyz(); echo $xyz; // xyz(31.3469,31.4749,99.0308) $hex2 = Hex::fromString('#2d78c8'); $ratio = Contrast::ratio(Hex::fromString('#f0fff0'), Hex::fromString('#191970')); echo $ratio; // 15.0 $cie76_distance = Distance::CIE76($rgb, $hex2); $cie76_distance = Distance::CIE76('rgba(55,155,255,1)', '#2d78c8'); // Outputs the same thing, Factory is built-in to all comparison functions echo $cie76_distance; // 55.89468042667388 $cie94_distance = Distance::CIE94($rgb, $hex2); echo $cie94_distance; // 13.49091942790753 $cie94_textiles_distance = Distance::CIE94($rgb, $hex2, 1); // Third parameter optionally sets the application type (0 = Graphic Arts [Default], 1 = Textiles) echo $cie94_textiles_distance; // 7.0926538068477 $ciede2000_distance = Distance::CIEDE2000($rgb, $hex2); echo $ciede2000_distance; // 12.711957696300898 ``` ## Support us [](https://spatie.be/github-ad-click/color) We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). ## Installation You can install the package via composer: ```bash composer require spatie/color ``` ## Usage The `Color` package contains a separate class per color format, which each implement a `Color` interface. There are seven classes which implement the `Color` interface: - `CIELab` - `Cmyk` - `Hex` - `Hsb` - `Hsl` - `Hsla` - `Rgb` - `Rgba` - `Xyz` ### `interface Spatie\Color\Color` #### `fromString(): Color` Parses a color string and returns a `Color` implementation, depending on the format of the input string. ```php Hex::fromString('#000000'); Rgba::fromString('rgba(255, 255, 255, 1)'); Hsla::fromString('hsla(360, 100%, 100%, 1)'); ``` Throws an `InvalidColorValue` exception if the string can't be parsed. > `Rgb`, `Rgba`, `Hsl` and `Hsla` strings are allowed to have spaces. `rgb(0,0,0)` is just as valid as `rgb(0, 0, 0)`. #### `red(): int|string` Return the value of the `red` color channel. ```php Hex::fromString('#ff0000')->red(); // 'ff' Rgb::fromString('rgb(255, 0, 0)')->red(); // 255 ``` #### `green(): int|string` Return the value of the `green` color channel. ```php Hex::fromString('#00ff00')->green(); // 'ff' Rgb::fromString('rgb(0, 255, 0)')->green(); // 255 ``` #### `blue(): int|string` Return the value of the `blue` color channel. ```php Hex::fromString('#0000ff')->blue(); // 'ff' Rgb::fromString('rgb(0, 0, 255)')->blue(); // 255 ``` #### `toCmyk(): Cmyk` Convert a color to a `Cmyk` color. ```php Rgb::fromString('rgb(0, 0, 255)')->toCmyk(); // `Cmyk` instance; 'cmyk(100,100,0,0)' ``` #### `toHex(): Hex` Convert a color to a `Hex` color. ```php Rgb::fromString('rgb(0, 0, 255)')->toHex(); // `Hex` instance; '#0000ff' ``` When coming from a color format that doesn't support opacity, it can be added by passing it to the `$alpha` parameter. #### `toHsb(): Hsb` Convert a color to a `Hsb` color. ```php Rgb::fromString('rgb(0, 0, 255)')->toHsb(); // `Hsl` instance; 'hsb(240, 100%, 100%)' ``` #### `toHsl(): Hsl` Convert a color to a `Hsl` color. ```php Rgb::fromString('rgb(0, 0, 255)')->toHsl(); // `Hsl` instance; 'hsl(240, 100%, 50%)' ``` When coming from a color format that supports opacity, the opacity will simply be omitted. ```php Rgba::fromString('rgba(0, 0, 255, .5)')->toHsl(); // `Hsl` instance; 'hsl(240, 100%, 50%)' ``` #### `toHsla(float $alpha = 1): Hsla` Convert a color to a `Hsla` color. ```php Rgb::fromString('rgb(0, 0, 255)')->toHsla(); // `Hsla` instance; 'hsla(240, 100%, 50%, 1.0)' ``` When coming from a color format that doesn't support opacity, it can be added by passing it to the `$alpha` parameter. ```php Rgb::fromString('rgb(0, 0, 255)')->toHsla(.5); // `Hsla` instance; 'hsla(240, 100%, 50%, 0.5)' ``` #### `toRgb(): Rgb` Convert a color to an `Rgb` color. ```php Hex::fromString('#0000ff')->toRgb(); // `Rgb` instance; 'rgb(0, 0, 255)' ``` When coming from a color format that supports opacity, the opacity will simply be omitted. ```php Rgba::fromString('rgb(0, 0, 255, .5)')->toRgb(); // `Rgb` instance; 'rgb(0, 0, 255)' ``` #### `toRgba(float $alpha = 1): Rgba` Convert a color to a `Rgba` color. ```php Rgb::fromString('rgb(0, 0, 255)')->toRgba(); // `Rgba` instance; 'rgba(0, 0, 255, 1)' ``` When coming from a color format that doesn't support opacity, it can be added by passing it to the `$alpha` parameter. ```php Rgba::fromString('rgb(0, 0, 255)')->toRgba(.5); // `Rgba` instance; 'rgba(0, 0, 255, .5)' ``` #### `__toString(): string` Cast the color to a string. ```php (string) Rgb::fromString('rgb(0, 0, 255)'); // 'rgb(0,0,255)' (string) Rgba::fromString('rgb(0, 0, 255, .5)'); // 'rgb(0,0,255,0.5)' (string) Hex::fromString('#0000ff'); // '#0000ff' (string) Hsla::fromString('hsl(240, 100%, 50%)'); // 'hsl(240, 100%, 50%)' (string) Hsla::fromString('hsla(240, 100%, 50%, 1.0)'); // 'hsla(240, 100%, 50%, 1.0)' ``` ### `Factory::fromString(): Color` With the `Factory` class, you can create a color instance from any string (it does an educated guess under the hood). If the string isn't a valid color string in any format, it throws an `InvalidColorValue` exception. ```php Factory::fromString('rgb(0, 0, 255)'); // `Rgb` instance Factory::fromString('#0000ff'); // `Hex` instance Factory::fromString('hsl(240, 100%, 50%)'); // `Hsl` instance Factory::fromString('Hello world!'); // `InvalidColorValue` exception ``` ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing ``` bash $ composer test ``` ## Contributing Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. ## Security If you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker. ## Credits - [Sebastian De Deyne](https://github.com/sebastiandedeyne) - [All Contributors](../../contributors) ## About Spatie Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource). ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information.