I am trying to write a regular expression by which i can replace rgb color value with hex code in a string. The string may have following types :
=> rgb(0, 0, 0) 0 0 0
=> rgb(0 100, 200)
=> 0 0 rgb(201,45,65)
First i want to access the rgb value from the string and then replace it back with hex code. So result will be :
=> #XXXXXX 0 0 0
=> #XXXXXX
=> 0 0 #XXXXXX