regex javascript to match both RGB and RGBA

It’s not so simple- an rgb is illegal with a fourth parameter. You also need to allow for percentage decimals as well as integer values for the rgb numbers. And spaces are allowed almost anywhere. function getRgbish(c){ var i= 0, itm, M= c.replace(/ +/g, ”).match(/(rgba?)|(\d+(\.\d+)?%?)|(\.\d+)/g); if(M && M.length> 3){ while(i<3){ itm= M[++i]; if(itm.indexOf(‘%’)!= -1){ itm= … Read more

Script (or some other means) to convert RGB to CMYK in PDF?

This answer is not for Illustrator, but for ‘some other tool’, namely Ghostscript (download gs871w32.exe or gs871w64.exe). Ghostscript allows you to ‘re-distill’ PDFs (without an intermediate conversion to PostScript, the dreaded ‘refrying’ detour). Try this command: gswin32c.exe ^ -o c:/path/to/output-cmyk.pdf ^ -sDEVICE=pdfwrite ^ -dUseCIEColor ^ -sProcessColorModel=DeviceCMYK ^ -sColorConversionStrategy=CMYK ^ -sColorConversionStrategyForImages=CMYK ^ input-rgb.pdf And if you … Read more

Converting Hex to RGB value in Python

I believe that this does what you are looking for: h = input(‘Enter hex: ‘).lstrip(‘#’) print(‘RGB =’, tuple(int(h[i:i+2], 16) for i in (0, 2, 4))) (The above was written for Python 3) Sample run: Enter hex: #B4FBB8 RGB = (180, 251, 184) Writing to a file To write to a file with handle fhandle while … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)