#421 HEX 색상코드 입력부분을 6자리에서 7자리로 변경(#이 포함될 경우를 위함)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3936 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2008-03-15 15:33:42 +00:00
parent 942871bc49
commit 883724b9c9
2 changed files with 10 additions and 9 deletions

View file

@ -784,15 +784,16 @@ function doAddDocumentCart(obj) {
/* ff의 rgb(a,b,c)를 #... 로 변경 */
function transRGB2Hex(value) {
if(!value) return value;
if(value.indexOf('#')>-1) return value.replace(/^#/,'');
if(value.indexOf('#') > -1) return value.replace(/^#/, '');
if(value.toLowerCase().indexOf('rgb')<0) return value;
value = value.replace(/^rgb\(/i,'').replace(/\)$/,'');
if(value.toLowerCase().indexOf('rgb') < 0) return value;
value = value.replace(/^rgb\(/i, '').replace(/\)$/, '');
value_list = value.split(',');
var hex = '';
for(var i=0;i<value_list.length;i++) {
var color = parseInt(value_list[i],10).toString(16);
for(var i = 0; i < value_list.length; i++) {
var color = parseInt(value_list[i], 10).toString(16);
if(color.length == 1) color = '0'+color;
hex += color;
}
return '#'+hex;