Index: extensions/common/image_util.cc |
diff --git a/extensions/browser/image_util.cc b/extensions/common/image_util.cc |
similarity index 83% |
rename from extensions/browser/image_util.cc |
rename to extensions/common/image_util.cc |
index 2454a632fee850b4bcb51b22314d1808921670f3..c8a143e881c6d3daa76f15d2b21ff0e339e16f83 100644 |
--- a/extensions/browser/image_util.cc |
+++ b/extensions/common/image_util.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "extensions/browser/image_util.h" |
+#include "extensions/common/image_util.h" |
#include <stdint.h> |
#include <vector> |
@@ -41,5 +41,13 @@ bool ParseCSSColorString(const std::string& color_string, SkColor* result) { |
return true; |
} |
+std::string GenerateCSSColorString(SkColor color) { |
+ char buffer[8]; |
+ |
+ sprintf(buffer, "#%02X%02X%02X", SkColorGetR(color), SkColorGetG(color), |
+ SkColorGetB(color)); |
+ return std::string(buffer); |
calamity
2014/12/09 03:46:12
Use base::StringPrintf instead. Fixed size buffers
benwells
2014/12/09 08:28:35
Done.
|
+} |
+ |
} // namespace image_util |
} // namespace extensions |