-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APM] Use same colors for HTTP status everywhere #47915
Conversation
💚 Build Succeeded
|
|
||
const httpStatusCodeColors: StringMap<string> = { | ||
1: euiColorDarkShade, | ||
2: euiColorSecondary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For "2xx" what do you think about using this instead of euiColorSecondary
?
import { darken } from "polished";
import { palettes } from "@elastic/eui/lib/services";
const color2xx = darken(0.2, palettes.euiPaletteForStatus.colors[0]);
Demo: https://codesandbox.io/s/http-status-colors-oxcpi
I think it works better as a "success" indicator, both in light and dark theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're keen to have custom colors for HTTP status, wouldn't it be better to specifically declare them in their own variable instead of passing in the EUI colors, which might change over time. We can grab the hex colors and just create our own set, and set the 2xx to the custom color you grabbed ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with that too. It just felt a bit more okay to extend the palette like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are worried about the custom color, using the default will also work:
const color2xx = palettes.euiPaletteForStatus.colors[0];
@elasticmachine merge upstream |
💚 Build Succeeded
|
Use the same colors on the RPM/TPM graphs as in the status code badge. Fixes elastic#47817.
9613d58
to
ed36dc3
Compare
💔 Build Failed |
💚 Build Succeeded |
* [APM] Use same colors for HTTP status everywhere Use the same colors on the RPM/TPM graphs as in the status code badge. Fixes elastic#47817. * don't export that const * Change colors * Remove unused import
Use the same colors on the RPM/TPM graphs as in the status code badge.
Fixes #47817.