Getting an rgb color from highlight groupprevent color scheme from bleeding into terminalgetting coordinates of a visual block via Neovim python APIColor questions for macOSSet text color for each columnHighlight arbitrary rectangular regionsHow to get 50 char long warning color highlight in vim gitcommit message without fugitiveHow to change Operator highlight color in Vim?How to set CursorLine highlight color for the gruvbox colorschemeIncremental Highlighting Colorscheme OverrideWhere can I find color settings used by Vim and NeoVim?
How to change the font style (not the size but the style) of algorithimc package
What to do when you reach a conclusion and find out later on that someone else already did?
Word for showing a small part of something briefly to hint to its existence or beauty without fully uncovering it
This message is flooding my syslog, how to find where it comes from?
Trying to build a function to compute divided difference for arbitrary list of points
Giant space birds hatching out of planets; short story
Why can't my huge trees be chopped down?
Character is called by their first initial. How do I write it?
Print sums of all subsets
Why are off grid solar setups only 12, 24, 48 VDC?
Is there a reason why I should not use the HaveIBeenPwned API to warn users about exposed passwords?
How acidic does a mixture have to be for milk to curdle?
How much were the LMs maneuvered to their landing points?
Explain why watch 'jobs' does not work but watch 'ps' work?
Why are all my history books dividing Chinese history after the Han dynasty?
"I you already know": is this proper English?
Is it legal for private citizens to "impound" e-scooters?
Piece-drop Mate #2
Why/when is AC-DC-AC conversion superior to direct AC-Ac conversion?
How do we explain the E major chord in this progression?
Request for a Latin phrase as motto "God is highest/supreme"
Send a single HTML email from Thunderbird, overriding the default "plain text" setting
Why do planes need a roll motion?
What does コテッと mean?
Getting an rgb color from highlight group
prevent color scheme from bleeding into terminalgetting coordinates of a visual block via Neovim python APIColor questions for macOSSet text color for each columnHighlight arbitrary rectangular regionsHow to get 50 char long warning color highlight in vim gitcommit message without fugitiveHow to change Operator highlight color in Vim?How to set CursorLine highlight color for the gruvbox colorschemeIncremental Highlighting Colorscheme OverrideWhere can I find color settings used by Vim and NeoVim?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In putting together and addon for blender to integrate neovim
.
Where I'm at with it, github colo imported to blender text editor from nvim_gtk
One component is grabbing the current colorscheme of a running vim and importing it into blender's text editor theme
So far I have some re
code that looks at the return of hi
and follows links if need be till I get a guifg or guibg
# vim is a pynvim.api.nvim.Nvim object
vim_color = vim.command_output(f"highlight g")
which for g = "pythonBuiltin"
returns
pythonBuiltin xxx links to GruvboxOrange
and so on
GruvboxOrange xxx ctermfg=208 guifg=#fe8019
in which case I can get the rgb colour for blender from the hex. Other colour codes not so easy. And the code is getting unwieldly.
Could you point me to a more direct way, possibly a plugin, to get the rgb value of a highlight?
neovim colorscheme color neovim-python-client
New contributor
add a comment |
In putting together and addon for blender to integrate neovim
.
Where I'm at with it, github colo imported to blender text editor from nvim_gtk
One component is grabbing the current colorscheme of a running vim and importing it into blender's text editor theme
So far I have some re
code that looks at the return of hi
and follows links if need be till I get a guifg or guibg
# vim is a pynvim.api.nvim.Nvim object
vim_color = vim.command_output(f"highlight g")
which for g = "pythonBuiltin"
returns
pythonBuiltin xxx links to GruvboxOrange
and so on
GruvboxOrange xxx ctermfg=208 guifg=#fe8019
in which case I can get the rgb colour for blender from the hex. Other colour codes not so easy. And the code is getting unwieldly.
Could you point me to a more direct way, possibly a plugin, to get the rgb value of a highlight?
neovim colorscheme color neovim-python-client
New contributor
add a comment |
In putting together and addon for blender to integrate neovim
.
Where I'm at with it, github colo imported to blender text editor from nvim_gtk
One component is grabbing the current colorscheme of a running vim and importing it into blender's text editor theme
So far I have some re
code that looks at the return of hi
and follows links if need be till I get a guifg or guibg
# vim is a pynvim.api.nvim.Nvim object
vim_color = vim.command_output(f"highlight g")
which for g = "pythonBuiltin"
returns
pythonBuiltin xxx links to GruvboxOrange
and so on
GruvboxOrange xxx ctermfg=208 guifg=#fe8019
in which case I can get the rgb colour for blender from the hex. Other colour codes not so easy. And the code is getting unwieldly.
Could you point me to a more direct way, possibly a plugin, to get the rgb value of a highlight?
neovim colorscheme color neovim-python-client
New contributor
In putting together and addon for blender to integrate neovim
.
Where I'm at with it, github colo imported to blender text editor from nvim_gtk
One component is grabbing the current colorscheme of a running vim and importing it into blender's text editor theme
So far I have some re
code that looks at the return of hi
and follows links if need be till I get a guifg or guibg
# vim is a pynvim.api.nvim.Nvim object
vim_color = vim.command_output(f"highlight g")
which for g = "pythonBuiltin"
returns
pythonBuiltin xxx links to GruvboxOrange
and so on
GruvboxOrange xxx ctermfg=208 guifg=#fe8019
in which case I can get the rgb colour for blender from the hex. Other colour codes not so easy. And the code is getting unwieldly.
Could you point me to a more direct way, possibly a plugin, to get the rgb value of a highlight?
neovim colorscheme color neovim-python-client
neovim colorscheme color neovim-python-client
New contributor
New contributor
New contributor
asked 8 hours ago
batFINGERbatFINGER
1083 bronze badges
1083 bronze badges
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Consider using the synIDattr()
function, which can take special attributes such as fg#
and bg#
to return RGB for attributes, when a GUI is running.
"fg#" like "fg", but for the GUI and the GUI
is running the name in "#RRGGBB" form
"bg#" like "fg#" for "bg"
"sp#" like "fg#" for "sp"
The first argument to this function is a numeric synID
, if you have a file styled with syntax elements you can look up the id from a specific position in the file.
If you want to find all syntax groups, then perhaps you could iterate them starting from 1 and looking up the name with synIDattr(..., 'name')
to build a full map from name to RGB attributes.
1
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!
– batFINGER
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
Cheers, Thisnvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....
– batFINGER
36 mins ago
add a comment |
I don't know about any plugins for this but it should be easy to code up lookup tables for the other codes.
The decimal numbers, like 208 in your example, are 256-color palette codes. It's easy to find translations to/from hex code. Like the top of the google search for 256 color to hex.
The spelled-out colors (e.g. DarkSeaGreen4) are system dependent. You didn't mention what system you're using, I don't think. But for *nix that same translation page includes spelled colors, too.. For windows start with :h win32-colors
and go from there.
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find usingmatplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.
– batFINGER
2 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "599"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
batFINGER is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f20753%2fgetting-an-rgb-color-from-highlight-group%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Consider using the synIDattr()
function, which can take special attributes such as fg#
and bg#
to return RGB for attributes, when a GUI is running.
"fg#" like "fg", but for the GUI and the GUI
is running the name in "#RRGGBB" form
"bg#" like "fg#" for "bg"
"sp#" like "fg#" for "sp"
The first argument to this function is a numeric synID
, if you have a file styled with syntax elements you can look up the id from a specific position in the file.
If you want to find all syntax groups, then perhaps you could iterate them starting from 1 and looking up the name with synIDattr(..., 'name')
to build a full map from name to RGB attributes.
1
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!
– batFINGER
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
Cheers, Thisnvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....
– batFINGER
36 mins ago
add a comment |
Consider using the synIDattr()
function, which can take special attributes such as fg#
and bg#
to return RGB for attributes, when a GUI is running.
"fg#" like "fg", but for the GUI and the GUI
is running the name in "#RRGGBB" form
"bg#" like "fg#" for "bg"
"sp#" like "fg#" for "sp"
The first argument to this function is a numeric synID
, if you have a file styled with syntax elements you can look up the id from a specific position in the file.
If you want to find all syntax groups, then perhaps you could iterate them starting from 1 and looking up the name with synIDattr(..., 'name')
to build a full map from name to RGB attributes.
1
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!
– batFINGER
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
Cheers, Thisnvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....
– batFINGER
36 mins ago
add a comment |
Consider using the synIDattr()
function, which can take special attributes such as fg#
and bg#
to return RGB for attributes, when a GUI is running.
"fg#" like "fg", but for the GUI and the GUI
is running the name in "#RRGGBB" form
"bg#" like "fg#" for "bg"
"sp#" like "fg#" for "sp"
The first argument to this function is a numeric synID
, if you have a file styled with syntax elements you can look up the id from a specific position in the file.
If you want to find all syntax groups, then perhaps you could iterate them starting from 1 and looking up the name with synIDattr(..., 'name')
to build a full map from name to RGB attributes.
Consider using the synIDattr()
function, which can take special attributes such as fg#
and bg#
to return RGB for attributes, when a GUI is running.
"fg#" like "fg", but for the GUI and the GUI
is running the name in "#RRGGBB" form
"bg#" like "fg#" for "bg"
"sp#" like "fg#" for "sp"
The first argument to this function is a numeric synID
, if you have a file styled with syntax elements you can look up the id from a specific position in the file.
If you want to find all syntax groups, then perhaps you could iterate them starting from 1 and looking up the name with synIDattr(..., 'name')
to build a full map from name to RGB attributes.
answered 2 hours ago
filbrandenfilbranden
1,5372 silver badges14 bronze badges
1,5372 silver badges14 bronze badges
1
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!
– batFINGER
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
Cheers, Thisnvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....
– batFINGER
36 mins ago
add a comment |
1
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!
– batFINGER
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
Cheers, Thisnvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....
– batFINGER
36 mins ago
1
1
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs
:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!– batFINGER
1 hour ago
You bloody beauty. I had begun recreating the wheel. So easy to find when you know where to look,... the answers pop strait from the docs
:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg#")
Thankyou that works like a treat!!!– batFINGER
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
I'm glad this helped! I happened to be in fact looking at something similar earlier this week (debugging syntax, so looking at how to see highlight group for a position) so I stared at these docs for a while. Good luck with your blender integration!
– filbranden
1 hour ago
Cheers, This
nvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....– batFINGER
36 mins ago
Cheers, This
nvim_inspect_cell
at first glance looked good.. Very new to vimscript, if you are a dab hand, could you please add the bare bones vimscript to buffer a syntax_test.py file, (and with a given dictionary of group.name : row, col) which outputs to a name : color value dictionary? What I think will take me 5mins.....– batFINGER
36 mins ago
add a comment |
I don't know about any plugins for this but it should be easy to code up lookup tables for the other codes.
The decimal numbers, like 208 in your example, are 256-color palette codes. It's easy to find translations to/from hex code. Like the top of the google search for 256 color to hex.
The spelled-out colors (e.g. DarkSeaGreen4) are system dependent. You didn't mention what system you're using, I don't think. But for *nix that same translation page includes spelled colors, too.. For windows start with :h win32-colors
and go from there.
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find usingmatplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.
– batFINGER
2 hours ago
add a comment |
I don't know about any plugins for this but it should be easy to code up lookup tables for the other codes.
The decimal numbers, like 208 in your example, are 256-color palette codes. It's easy to find translations to/from hex code. Like the top of the google search for 256 color to hex.
The spelled-out colors (e.g. DarkSeaGreen4) are system dependent. You didn't mention what system you're using, I don't think. But for *nix that same translation page includes spelled colors, too.. For windows start with :h win32-colors
and go from there.
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find usingmatplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.
– batFINGER
2 hours ago
add a comment |
I don't know about any plugins for this but it should be easy to code up lookup tables for the other codes.
The decimal numbers, like 208 in your example, are 256-color palette codes. It's easy to find translations to/from hex code. Like the top of the google search for 256 color to hex.
The spelled-out colors (e.g. DarkSeaGreen4) are system dependent. You didn't mention what system you're using, I don't think. But for *nix that same translation page includes spelled colors, too.. For windows start with :h win32-colors
and go from there.
I don't know about any plugins for this but it should be easy to code up lookup tables for the other codes.
The decimal numbers, like 208 in your example, are 256-color palette codes. It's easy to find translations to/from hex code. Like the top of the google search for 256 color to hex.
The spelled-out colors (e.g. DarkSeaGreen4) are system dependent. You didn't mention what system you're using, I don't think. But for *nix that same translation page includes spelled colors, too.. For windows start with :h win32-colors
and go from there.
edited 3 hours ago
answered 3 hours ago
B LayerB Layer
6,8871 gold badge6 silver badges24 bronze badges
6,8871 gold badge6 silver badges24 bronze badges
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find usingmatplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.
– batFINGER
2 hours ago
add a comment |
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find usingmatplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.
– batFINGER
2 hours ago
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find using
matplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.– batFINGER
2 hours ago
On Ubuntu. Thanks. I was afraid it would come down to LUTs. ... so I'm going to be slow about accepting that fate lol. Find using
matplotlib.colors
methods covers most named colors eg these but will need to delve into what, for example LUT 4 represents . Was hoping there may be some sneaky way to get a rgb from a "live" hightlight.– batFINGER
2 hours ago
add a comment |
batFINGER is a new contributor. Be nice, and check out our Code of Conduct.
batFINGER is a new contributor. Be nice, and check out our Code of Conduct.
batFINGER is a new contributor. Be nice, and check out our Code of Conduct.
batFINGER is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Vi and Vim Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f20753%2fgetting-an-rgb-color-from-highlight-group%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown