Skip to content

Commit cbc013b

Browse files
authored
Directly use photon-colors (#5821)
Fixed #5820 This removes a cached copy of photon colors inside the colors.ts, and let it directly use the photon-colors module.
2 parents 743f422 + ca86724 commit cbc013b

File tree

2 files changed

+23
-72
lines changed

2 files changed

+23
-72
lines changed

src/components/js-tracer/Canvas.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* This Source Code Form is subject to the terms of the Mozilla Public
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4-
import { GREY_20 } from 'photon-colors';
4+
import { GREY_20, BLUE_40 } from 'photon-colors';
55
import * as React from 'react';
66
import classNames from 'classnames';
77
import {
@@ -16,7 +16,6 @@ import { ChartCanvas } from 'firefox-profiler/components/shared/chart/Canvas';
1616
import TextMeasurement from 'firefox-profiler/utils/text-measurement';
1717
import { FastFillStyle } from 'firefox-profiler/utils';
1818
import type { updatePreviewSelection } from 'firefox-profiler/actions/profile-view';
19-
import { BLUE_40 } from 'firefox-profiler/utils/colors';
2019

2120
import type {
2221
Milliseconds,

src/utils/colors.ts

Lines changed: 22 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,28 @@
44

55
import { lightDark, maybeLightDark } from './dark-mode';
66

7-
/**
8-
* These are the colors from Photon. They are inlined to provide easy access. If updating
9-
* please change the CSS variables as well.
10-
*
11-
* Firefox Colors v1.0.3
12-
* https://github.com/FirefoxUX/photon-colors/blob/master/photon-colors.js
13-
*/
14-
15-
export const MAGENTA_50 = '#ff1ad9';
16-
export const MAGENTA_60 = '#ed00b5';
17-
export const MAGENTA_70 = '#b5007f';
18-
export const MAGENTA_80 = '#7d004f';
19-
export const MAGENTA_90 = '#440027';
20-
21-
export const PURPLE_50 = '#9400ff';
22-
export const PURPLE_60 = '#8000d7';
23-
export const PURPLE_70 = '#6200a4';
24-
export const PURPLE_80 = '#440071';
25-
export const PURPLE_90 = '#25003e';
26-
27-
export const BLUE_40 = '#45a1ff';
28-
export const BLUE_50 = '#0a84ff';
29-
export const BLUE_60 = '#0060df';
30-
export const BLUE_70 = '#003eaa';
31-
export const BLUE_80 = '#002275';
32-
export const BLUE_90 = '#000f40';
33-
34-
export const TEAL_50 = '#00feff';
35-
export const TEAL_60 = '#00c8d7';
36-
export const TEAL_70 = '#008ea4';
37-
export const TEAL_80 = '#005a71';
38-
export const TEAL_90 = '#002d3e';
39-
40-
export const GREEN_50 = '#30e60b';
41-
export const GREEN_60 = '#12bc00';
42-
export const GREEN_70 = '#058b00';
43-
export const GREEN_80 = '#006504';
44-
export const GREEN_90 = '#003706';
45-
46-
export const YELLOW_50 = '#ffe900';
47-
export const YELLOW_60 = '#d7b600';
48-
export const YELLOW_70 = '#a47f00';
49-
export const YELLOW_80 = '#715100';
50-
export const YELLOW_90 = '#3e2800';
51-
52-
export const RED_50 = '#ff0039';
53-
export const RED_60 = '#d70022';
54-
export const RED_70 = '#a4000f';
55-
export const RED_80 = '#5a0002';
56-
export const RED_90 = '#3e0200';
57-
58-
export const ORANGE_50 = '#ff9400';
59-
export const ORANGE_60 = '#d76e00';
60-
export const ORANGE_70 = '#a44900';
61-
export const ORANGE_80 = '#712b00';
62-
export const ORANGE_90 = '#3e1300';
63-
64-
export const GREY_10 = '#f9f9fa';
65-
export const GREY_20 = '#ededf0';
66-
export const GREY_30 = '#d7d7db';
67-
export const GREY_40 = '#b1b1b3';
68-
export const GREY_50 = '#737373';
69-
export const GREY_60 = '#4a4a4f';
70-
export const GREY_70 = '#38383d';
71-
export const GREY_80 = '#2a2a2e';
72-
export const GREY_90 = '#0c0c0d';
73-
74-
export const INK_70 = '#363959';
75-
export const INK_80 = '#202340';
76-
export const INK_90 = '#0f1126';
7+
import {
8+
BLUE_40,
9+
BLUE_60,
10+
GREEN_50,
11+
GREEN_60,
12+
GREEN_70,
13+
GREY_20,
14+
GREY_30,
15+
GREY_40,
16+
GREY_50,
17+
GREY_60,
18+
GREY_70,
19+
MAGENTA_60,
20+
MAGENTA_70,
21+
ORANGE_50,
22+
ORANGE_60,
23+
ORANGE_70,
24+
PURPLE_70,
25+
RED_60,
26+
RED_70,
27+
YELLOW_50,
28+
} from 'photon-colors';
7729

7830
type ColorStyles = {
7931
readonly _selectedFillStyle: string | [string, string];

0 commit comments

Comments
 (0)