Convert rgb to hex in php
in my code i have
i want to convert this into hex color code.Out put like
asked Oct 6, 2015 at 5:51
2 A simple
To break down the format:
answered Oct 6, 2015 at 19:06
user3942918user3942918 25.2k12 gold badges54 silver badges67 bronze badges 0 You can use following function
Then, Source: RGB to hex colors and hex colors to RGB - PHP answered Oct 6, 2015 at 5:58
SuyogSuyog 2,4541 gold badge13 silver badges26 bronze badges 0 You can try this simple piece of code below. You can pass the rgb code dynamically as well in the code.
This will code return like #7bde84 answered Nov 23, 2016 at 9:52
IAmMilinPatelIAmMilinPatel 3831 gold badge9 silver badges18 bronze badges 3 Here is a function that will accept the string version of either an
Example: answered Nov 13, 2019 at 15:36
Mat LipeMat Lipe 6146 silver badges10 bronze badges 0 You can try this
answered Oct 6, 2015 at 5:56
Rajarshi DasRajarshi Das 11.5k5 gold badges41 silver badges68 bronze badges In case you want to use external solutions, https://github.com/spatie/color
answered Feb 22, 2021 at 15:41
Ostap BrehinOstap Brehin 2,4893 gold badges23 silver badges26 bronze badges |