Skip to content
Advertisement

Tag: rgb

PHP longhand hex to RGB not working correctly

How do I convert longhand hex to RGB(A)? For example, I have the following code to convert all formats of hex, colorname, etc.. to RGBA for background opacity, but for some reason longhand hex does not work, but instead takes the shorthand from the longhand (eg. background-color: #0000ff; becomes background-color: #000;). Alot of the code below is based off of

Convert RBG to CMYK with use of ICC profile in PHP

I am currently building an online APP which allows users to pick a color for text from a usual javascript color picker. I want to convert the returned value to CMYK and I know there is not one simple run-of-the-mill method to achieve this, given there are ICC profiles and all that. I still want to achieve a relatively useful

Advertisement