akalongman / sublimetext-stringutilities

Sublime Text 2/3 plugin for string manipulations
MIT License
83 stars 24 forks source link

Convert HTML Hex Color to RGB Color and viceversa does not work. #10

Closed mauriciord506 closed 8 years ago

mauriciord506 commented 8 years ago

Im testing the plugin and above function does not seem to work. I tried to convert the following hex colors to RGB:

#FFF
#fff
#FFFFFF
#ffffff

It did not work, I also tried to convert RGB to HEX like for example:

rgb(0,2,33);

Did not work either.

Im getting the following errors in the console


Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 556, in run_
    return self.run(edit)
  File "/Users/Hyde1942/Library/Application Support/Sublime Text 3/Packages/StringUtilities/stringutilities.py", line 188, in run
    self.view.replace(edit, region, self.hex_to_rgb(text))
  File "/Users/Hyde1942/Library/Application Support/Sublime Text 3/Packages/StringUtilities/stringutilities.py", line 197, in hex_to_rgb
    value = value.lstrip('#')
TypeError: Type str doesn't support the buffer API
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 556, in run_
    return self.run(edit)
  File "/Users/Hyde1942/Library/Application Support/Sublime Text 3/Packages/StringUtilities/stringutilities.py", line 217, in run
    rgb_match = re.match(reg_rgb, text)
  File "./re.py", line 156, in match
TypeError: can't use a string pattern on a bytes-like object
screen shot 2015-10-08 at 7 13 57 pm
akalongman commented 8 years ago

Fixed in 1.4.0