Link Details

Link 967157 thumbnail
User 1120803 avatar

By hamdusa
via pageconfig.com
Submitted: May 13 2013 / 11:11

When working with CSS, it is common to use Hexadecimal Notation of colors, while on the back end, many PHP functions (like imagecolorallocate, imagecolorclosest, imagecolorexact etc, require that you pass on colors as red, green and blue integers. The below function can be helpful if you need to convert hexadecimal color literal to red, green and blue int values for use elsewhere. This function accepts hex, converts to RGB and stores the respective color values in $red, $green and $blue variables passed by reference.
  • 2
  • 0
  • 141
  • 64

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Upvoters (2)



Downvoters (0)



    Apache Hadoop
    Written by: Piotr Krewski
    Featured Refcardz: Top Refcardz:
    1. Play
    2. Akka
    3. Design Patterns
    4. OO JS
    5. Cont. Delivery
    1. Play
    2. Java Performance
    3. Akka
    4. REST
    5. Java