Skip to content
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

bright colors support #1083

Open
apprehensions opened this issue Mar 19, 2023 · 4 comments
Open

bright colors support #1083

apprehensions opened this issue Mar 19, 2023 · 4 comments
Labels
meta:feature-request meta:help-wanted Good for developers with limited familiarity with the codebase.

Comments

@apprehensions
Copy link
Contributor

i've been trying to implement this into vis myself, but as i'm unfamiliar with C, i was not able to.

to put it simply, the current color indexes are 30 (fg) and 40 (bg); there should be a style mode (similar to bold) that simply adds 60 to these values, making them bright colored.

ncurses does this a bit differently unfortunately..

https://en.wikipedia.org/wiki/ANSI_escape_code

@rnpnr rnpnr added meta:feature-request meta:help-wanted Good for developers with limited familiarity with the codebase. labels Oct 10, 2023
@lobre
Copy link

lobre commented Oct 12, 2023

I have not properly dug the code but by trying numbers instead of string colors, I manage to have bright versions. Such as:

local bright = {
    black   = 8,
    red     = 9,
    green   = 10,
    yellow  = 11,
    blue    = 12,
    magenta = 13,
    cyan    = 14
}

...
lexers.STYLE_LINENUMBER = 'fore:'..bright.black
...

@apprehensions
Copy link
Contributor Author

apprehensions commented Nov 10, 2023

@lobre i'm glad you managed to find a way! but, it doesn't seem to do anything on my end..

(Nevermind, i'm just colorblind.)

this is why it works:
netbsd-curses:

/*
 * Color definitions (ANSI color numbers)
 */

#define	COLOR_BLACK	0x00
#define	COLOR_RED	0x01
#define	COLOR_GREEN	0x02
#define	COLOR_YELLOW	0x03
#define	COLOR_BLUE	0x04
#define	COLOR_MAGENTA	0x05
#define	COLOR_CYAN	0x06
#define	COLOR_WHITE	0x07

vis:

#define CELL_COLOR_BLACK   COLOR_BLACK
#define CELL_COLOR_RED     COLOR_RED
#define CELL_COLOR_GREEN   COLOR_GREEN
#define CELL_COLOR_YELLOW  COLOR_YELLOW
#define CELL_COLOR_BLUE    COLOR_BLUE
#define CELL_COLOR_MAGENTA COLOR_MAGENTA
#define CELL_COLOR_CYAN    COLOR_CYAN
#define CELL_COLOR_WHITE   COLOR_WHITE
#define CELL_COLOR_DEFAULT (-1)

@lobre
Copy link

lobre commented Nov 13, 2023

I am not sure I get your point. Can you please explain why you think it works? I don't see any bright definitions in the code you posted.

@apprehensions
Copy link
Contributor Author

vis (or ncurses to be specific) only has the default normal colors 0-7 colors indexed with their representative strings red, green, etc.
your way works because it adds the mixing other bright 8-15 colors.

although ncurses itself has no bright color support it seems..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta:feature-request meta:help-wanted Good for developers with limited familiarity with the codebase.
Projects
None yet
Development

No branches or pull requests

3 participants