-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
feat: Assign labels a color #59
Comments
My thought on this:
My proposal:
|
For the termui, there needs to be a fallback for the colors since some terminals only support 16 or 256 colors. |
@j-f1 good point. That should be fairly easy to reduce the color precision to 16 or 8bits. I'm a bit confused as to how one is supposed to detect the terminal capabilities. I have the same question for how to detect the terminal size btw. |
Here’s a series of checks (in JavaScript, from the if (env.COLORTERM === 'truecolor') {
return 3;
}
if ('TERM_PROGRAM' in env) {
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
return version >= 3 ? 3 : 2;
case 'Apple_Terminal':
return 2;
// No default
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ('COLORTERM' in env) {
return 1;
}
if (env.TERM === 'dumb') {
return min;
} |
@j-f1 Thanks More info on the subject: https://gist.github.com/XVilka/8346728 I found a go implementation: https://github.com/xo/terminfo/blob/master/color.go#L49-L91 |
Label's color are now defined directly in the core and used in the webUI through the graphQL API. Next steps are:
|
Code used by Github's hub command to display labels: https://github.com/github/hub/blob/master/utils/color.go |
Mind if I ask the current state of this issue? |
Labels should be displayed everywhere with the correct color, but you can't choose the color yourself. That would require a proper configuration data structured stored in git and shared. |
Alright, I understand. Do you planning to support colour selection in near future? |
Probably not as there is some significant development with higher priority (some being required to implement that feature). |
I second @vtexier. On the CLI and TUI, displaying a (coloured) character (e.g. the first letter of the label) would be much more useful than the current square. I just created 2 labels on a repo and git-bug chose exactly the same colour for them. |
) from ja/glamour into master Reviewed-on: https://gitea.daedalean.ai/daedalean-github/git-ticket/pulls/59 Reviewed-by: Ian Whittington <iw@daedalean.ai> Ref T16575
It would be nice to be able to assign each label a color, and use that color every time the label is printed.
The text was updated successfully, but these errors were encountered: