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

Unified Diff: third_party/WebKit/Source/devtools/front_end/common/Color.js

Issue 2827843002: [Devtools] Network waterfall and grid rows feed bg color from same place (Closed)
Patch Set: changes Created 3 years, 8 months 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: third_party/WebKit/Source/devtools/front_end/common/Color.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Color.js b/third_party/WebKit/Source/devtools/front_end/common/Color.js
index ed25f69a236388ae333ce2b4a893177e14d2809f..658836a1abdafa4e562e757b1cedaf31d7c39e57 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/Color.js
+++ b/third_party/WebKit/Source/devtools/front_end/common/Color.js
@@ -225,8 +225,9 @@ Common.Color = class {
/**
* @param {!Array.<number>} hsl
* @param {!Array.<number>} out_rgb
+ * @param {boolean=} asCanonical
pfeldman 2017/04/19 19:52:03 asCanonical does not say much to me.
allada 2017/04/19 23:38:46 It's name is modeled after: https://cs.chromium.or
*/
- static hsl2rgb(hsl, out_rgb) {
+ static hsl2rgb(hsl, out_rgb, asCanonical) {
var h = hsl[0];
var s = hsl[1];
var l = hsl[2];
@@ -260,10 +261,10 @@ Common.Color = class {
var tr = h + (1 / 3);
var tg = h;
var tb = h - (1 / 3);
-
- out_rgb[0] = hue2rgb(p, q, tr);
- out_rgb[1] = hue2rgb(p, q, tg);
- out_rgb[2] = hue2rgb(p, q, tb);
+ var multiplier = asCanonical ? 255 : 1;
+ out_rgb[0] = hue2rgb(p, q, tr) * multiplier;
pfeldman 2017/04/19 19:52:02 Do you want whole numbers here in case of 255?
allada 2017/04/19 23:38:46 Yes.
+ out_rgb[1] = hue2rgb(p, q, tg) * multiplier;
+ out_rgb[2] = hue2rgb(p, q, tb) * multiplier;
out_rgb[3] = hsl[3];
}

Powered by Google App Engine
This is Rietveld 408576698