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

Unified Diff: tracing/tracing/base/color_scheme.html

Issue 1429863004: Actually fix analysis link hovering (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « tracing/tracing/base/color.html ('k') | tracing/tracing/base/color_scheme_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/color_scheme.html
diff --git a/tracing/tracing/base/color_scheme.html b/tracing/tracing/base/color_scheme.html
index ea41399e877179ce1d6b7c462986241edf05ed10..662237ef43ef48be2e11741cd2226204ed809663 100644
--- a/tracing/tracing/base/color_scheme.html
+++ b/tracing/tracing/base/color_scheme.html
@@ -87,12 +87,12 @@ tr.exportTo('tr.b', function() {
// Some constants we'll need for later lookups.
var numGeneralPurposeColorIds = generalPurposeColors.length;
var numReservedColorIds = tr.b.dictionaryLength(reservedColorsByName);
- var numBaseColors = numGeneralPurposeColorIds + numReservedColorIds;
+ var numColorsPerVariant = numGeneralPurposeColorIds + numReservedColorIds;
class ColorScheme {
};
- /**
+ /*
* A flat array of tr.b.Color values of the palette, and their variants.
*
* This array is made up of a set of base colors, repeated N times to form
@@ -115,29 +115,56 @@ tr.exportTo('tr.b', function() {
* 4: Brightened Generic Color 1
* 5: Brightened Named Color 'foo'
*/
- ColorScheme.colors = (function() {
- var paletteBase = [];
- paletteBase.push.apply(paletteBase, generalPurposeColors);
- paletteBase.push.apply(paletteBase,
- tr.b.dictionaryValues(reservedColorsByName));
-
- var combinedItems = [];
- combinedItems.push.apply(combinedItems,
- paletteBase);
- combinedItems.push.apply(combinedItems,
- paletteBase.map(function(c) {
- return c.lighten(0.3, 0.9);
- }));
- combinedItems.push.apply(combinedItems,
- paletteBase.map(function(c) {
- return c.lighten(0.5, 0.9);
- }));
- combinedItems.push.apply(combinedItems,
- paletteBase.map(function(c) {
- return c.desaturate();
- }));
- return combinedItems;
- })();
+ var paletteBase = [];
+ paletteBase.push.apply(paletteBase, generalPurposeColors);
+ paletteBase.push.apply(paletteBase,
+ tr.b.dictionaryValues(reservedColorsByName));
+ ColorScheme.colors = [];
+ ColorScheme.properties = {};
+ ColorScheme.properties = {
+ numColorsPerVariant: numColorsPerVariant
+ };
+
+ function pushVariant(func) {
+ var variantColors = paletteBase.map(func);
+ ColorScheme.colors.push.apply(ColorScheme.colors, variantColors);
+ }
+
+ // Basic colors.
+ pushVariant(function(c) { return c; });
+
+ // Brightened variants.
+ ColorScheme.properties.brightenedOffsets = [];
+ ColorScheme.properties.brightenedOffsets.push(ColorScheme.colors.length);
+ pushVariant(function(c) {
+ return c.lighten(0.3, 0.9);
+ });
+
+ ColorScheme.properties.brightenedOffsets.push(ColorScheme.colors.length);
+ pushVariant(function(c) {
+ return c.lighten(0.48, 0.9);
+ });
+
+ ColorScheme.properties.brightenedOffsets.push(ColorScheme.colors.length);
+ pushVariant(function(c) {
+ return c.lighten(0.65, 0.9);
+ });
+
+
+ // Desaturated variants.
+ ColorScheme.properties.dimmedOffsets = [];
+ ColorScheme.properties.dimmedOffsets.push(ColorScheme.colors.length);
+ pushVariant(function(c) {
+ return c.desaturate();
+ });
+ ColorScheme.properties.dimmedOffsets.push(ColorScheme.colors.length);
+ pushVariant(function(c) {
+ return c.desaturate(0.5);
+ });
+ ColorScheme.properties.dimmedOffsets.push(ColorScheme.colors.length);
+ pushVariant(function(c) {
+ return c.desaturate(0.3);
+ });
/**
* A toString'd representation of ColorScheme.colors.
@@ -146,14 +173,6 @@ tr.exportTo('tr.b', function() {
return c.toString();
});
- ColorScheme.properties = {
- numBaseColors: numBaseColors,
- numGeneralPurposeColorIds: numGeneralPurposeColorIds,
- selectedIdBoost: numBaseColors,
- highlightedIdBoost: numBaseColors * 2,
- dimmedIdBoost: numBaseColors * 3
- };
-
// Build reservedColorNameToIdMap.
var reservedColorNameToIdMap = (function() {
var m = {};
« no previous file with comments | « tracing/tracing/base/color.html ('k') | tracing/tracing/base/color_scheme_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698