spatie / color

A little library to deal with color conversions
https://spatie.be/opensource/php
MIT License
350 stars 36 forks source link

Idea: Add opacity support to Hex colors #63

Closed kodie closed 2 years ago

kodie commented 2 years ago

Hex colors can contain opacity data by adding them to the beginning of the color code.

For example: #66000000 is black with 40% alpha transparency.

Some info here: https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4

Just an idea, I may try tackling this at some point but I also don't want it to be a breaking change so maybe the best way of going about it would be to add a fourth optional parameter to the Hex constructor.

sebastiandedeyne commented 2 years ago

This was added in https://github.com/spatie/color/pull/54 :)