php-watermark icon indicating copy to clipboard operation
php-watermark copied to clipboard

Font color

Open shqawe1 opened this issue 2 years ago • 3 comments

Add new function with name setFontColor to have ability to change font color. and this function accepting just RGB & RGBA format.

Example:

`$watermark->setFont('Arial') ->setFontSize(36) ->setOpacity(.4) ->setRotate(330) ->setFontColor('rgba(255, 255, 255,0)') ->setOffset(-80, 200) ->setPosition(Watermark::POSITION_RIGHT);

$text = "ajaxray.com"; $watermark->withText($text, DIR.'/img/result_simple.jpg');`

shqawe1 avatar Aug 14 '23 19:08 shqawe1

Assalamualaikum @shqawe1 ,

I am very happy that you've solved it and want to share the solution! 🤗

I was trying to test it and found a few tiny issues. If you can manage a few more minutes, can you please look into the points I've mentioned above?

Also, if you could list all the supported color formats that will work after merging this, that would be very much helpful. I'll use the list to add to the readme file.

Thanks a lot, brother! Your contribution is very much appreciated! ❤️

ajaxray avatar Aug 15 '23 07:08 ajaxray

First of all i want you to accept my apologize for these mistakes because i wrote it quickly as copy paste from my project. And i reply with correct code for each one of the issue and i hope it will work without any issue.

About the color format the code accept rgb & rgba formats. rgb(255, 255, 255)

rgba(255, 255, 255, 0.4)

shqawe1 avatar Aug 15 '23 10:08 shqawe1

Are there any plans to merge this? I want to use it for a project but could not do so without this functionality.

jacob-gardiner avatar Jun 25 '24 21:06 jacob-gardiner