-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter-tree and timeline-chart rows are now highlighted when selected. Selecting a row in the timeline-chart selects the row in the filter-tree, and vice-versa. Highlighted color matches the current color theme. Fixes: #772, #774 Signed-off-by: Will Yang <william.yang@ericsson.com>
- Loading branch information
1 parent
0e186e0
commit c558e0d
Showing
9 changed files
with
124 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Converts a string representing a color into a number. Works with both RGB strings and hex number strings. Ignores alpha values. | ||
* @param {string} rgb RGB or hex string for a color. | ||
* @returns {number} Hex number of the input string. Ignores alpha value if present. | ||
*/ | ||
export function convertColorStringToHexNumber(rgb: string): number { | ||
let string = '0'; | ||
if (rgb[0] === '#') { | ||
// We are working with hex string. | ||
string = '0x' + rgb.slice(1); | ||
} else if (rgb[0] === 'r') { | ||
// Working with RGB String | ||
const match = rgb.match(/\d+/g); | ||
if (match) { | ||
string = '0x' + match.map(x => { | ||
x = parseInt(x).toString(16); | ||
return (x.length === 1) ? '0' + x : x; | ||
}).join(''); | ||
string = string.slice(0, 8); | ||
} | ||
} | ||
return Number(string); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters