Skip to content

Add 24bit color support#43

Merged
buger merged 6 commits intobuger:masterfrom
different55:RGB
May 22, 2022
Merged

Add 24bit color support#43
buger merged 6 commits intobuger:masterfrom
different55:RGB

Conversation

@different55
Copy link
Contributor

Very old, don't know if this is wanted or good anymore but I'm going through all my repositories and making pull requests for the stuff I apparently never did. Can redo or touch up anything needed, just let me know!

According to the standard, colors 39 and 49 can be used to switch
to the terminal default colors for foreground and background
respectively. RESET_COLOR now uses 39;49 instead of 32, which
only sets the foreground color to green.
Added support for 24bit foreground and background colors with
CSI[38;2;<r>;<g>;<b>m and CSI[48;2;<r>;<g>;<b>m through the
GetRGBColor() and GetBgRGBColor() functions.
Oh holy crap I didn't realize getColor and getBgColor weren't
exported. Seems a little weird but here I'll add ColorRGB and
BackgroundRGB to format strings in 24bit color.
You know what how about we just export these, is there any reason
to enforce wrapping it around a string line by line? I can't think
of any reason to not allow the user to handle it.
Since the ColorRGB and BackgroundRGB functions have the RGB as a
suffix we should probably do the same for the GetRGBColor functions
as well.
@buger
Copy link
Owner

buger commented May 22, 2022

Nice!

Looks cool!

@buger buger merged commit 0ebe063 into buger:master May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants