Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1326)

Unified Diff: Source/devtools/front_end/elements/Spectrum.js

Issue 756913002: DevTools: Rename WI.Color's toString(format) -> asString(format) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix tests Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/Spectrum.js
diff --git a/Source/devtools/front_end/elements/Spectrum.js b/Source/devtools/front_end/elements/Spectrum.js
index effbdc30ae50df2296c1b71f440685fb476f3cad..d88fc54b10331c961f48e4ef7ed7b5fecd4edade 100644
--- a/Source/devtools/front_end/elements/Spectrum.js
+++ b/Source/devtools/front_end/elements/Spectrum.js
@@ -230,22 +230,22 @@ WebInspector.Spectrum.prototype = {
var cf = WebInspector.Color.Format;
var format = this._originalFormat;
var color = this.color();
- var originalFormatString = color.toString(this._originalFormat);
+ var originalFormatString = color.asString(this._originalFormat);
if (originalFormatString)
return originalFormatString;
if (color.hasAlpha()) {
// Everything except HSL(A) should be returned as RGBA if transparency is involved.
if (format === cf.HSLA || format === cf.HSL)
- return color.toString(cf.HSLA);
+ return color.asString(cf.HSLA);
else
- return color.toString(cf.RGBA);
+ return color.asString(cf.RGBA);
}
if (format === cf.ShortHEX)
- return color.toString(cf.HEX);
+ return color.asString(cf.HEX);
console.assert(format === cf.Nickname);
- return color.toString(cf.RGB);
+ return color.asString(cf.RGB);
},
@@ -288,8 +288,8 @@ WebInspector.Spectrum.prototype = {
{
this._updateHelperLocations();
- this._draggerElement.style.backgroundColor = /** @type {string} */ (WebInspector.Color.fromHSVA([this._hsv[0], 1, 1, 1]).toString(WebInspector.Color.Format.RGB));
- this._swatchInnerElement.style.backgroundColor = /** @type {string} */ (this.color().toString(WebInspector.Color.Format.RGBA));
+ this._draggerElement.style.backgroundColor = /** @type {string} */ (WebInspector.Color.fromHSVA([this._hsv[0], 1, 1, 1]).asString(WebInspector.Color.Format.RGB));
+ this._swatchInnerElement.style.backgroundColor = /** @type {string} */ (this.color().asString(WebInspector.Color.Format.RGBA));
this._alphaElement.value = this._hsv[3] * 100;
},
« no previous file with comments | « Source/devtools/front_end/elements/MetricsSidebarPane.js ('k') | Source/devtools/front_end/elements/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698