Tag Archives: rgb

PHP: Convert Web Hex Color Code to RGB Array

Sometimes you need to RGB array that makes up a color when working in the wonderful world of PHP. Don’t ask me why or when, though that said, I have required it at least once before when setting text color whilst generating PDFs using the FPDF library – so I have at least established that you do sometimes want to do this Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , | View Comments

PHP: Convert a RGB color Array into a Web Hex Code

RGB, that annoying little way of expressing a color via values between 0 and 255 for each of the three components that makes up a color. Always in the form of an array consisting of three values, namely one for red, one for green and one for blue, wouldn’t it be nice if we had a simple function that automatically converted such an array to the more universal web hex code? (Well when I say universal I mean developing on the web). Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , | View Comments

jQuery Color Picker Plugin: Convert RGB to HEX

I’ve written on the excellent jQuery Color Picker plugin from eyecon.ro before, but a question was recently raised on how to use its RGB output in code. Well actually it turns out that most browsers return its value as a standard HEX color value, but one browser in particular (and I’m not naming names here but it is the one who everyone who think themselves better than the average home user seems to love) returns the value as a RGB color string. Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , | View Comments

Convert FireFox Color rgb(xxx,yyy,zzz) to Hex

Firefox has a nasty habit of returning element background colors and colors in general in the format rgb(xxx,yyy,zzz) as opposed to the normal #xxyyzz. Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , , , , , | View Comments