-
-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background color for text #302
Comments
This isn't currently possible, but you can call That's not super efficient, of course. I'd accept a PR that adds this capability to |
Hey, I would like to tackle this issue! Would you be able to explain how you test your application since it is not provided in the explanation? Do I just fork the repo into VSCode and start working from there, as I already followed your installation guide? |
|
public function text($text, $options, $backgroundColor, &$boundary = null) {
I have never used PHP before so please let me know if my approach is poor, but I have attempted to minimize the calling of text by creating a new backroundColor parameter for text(). Then, I added code after the boundaries are set which generates a rectangle that will be written over by the text after being called. I made it an if statement because I was unsure if it is possible to set a default value for backgroundColor in PHP. If so it would only generate the rectangle if the color isn't white, which I assumed was default, and potentially it would allow users to not have to add an additional input and use the function the same why they did before I added the extra parameter. Please let me know if I have any fault in my logic otherwise I will create a pull request and push the code. |
I don't know of a more efficient way to do this using GD, aside from the suggestion I made above. I would like to make sure text($text, $options, &$boundary, $backgroundColor) {
// ...
} At this time, there are no tests in the library. You can test things out locally using the example folder. |
Hey @claviska, I made a pull request with a function that specifically has a solution for this feature. Would you be able to explain how I can test this code using the example folder, as I am not familiar with testing in PHP? |
Whoops, I completely overlooked the existing Let me know if you have any questions! |
Hi is it possible to set backgroud color for text adding to image?
The text was updated successfully, but these errors were encountered: