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?
Getting an entry level IT position later in life
The actual purview of Her Majesty The Queen's Perogative?
Why can I log in to my Facebook account with a misspelled email/password?
What is the bio-mechanical plausibility of a fox with venomous fangs?
Unexpected route on a flight from USA to Europe
Count number of occurences of particular numbers in list
How to halve redstone signal strength?
What word best describes someone who likes to do everything on his own?
Is Odin inconsistent about the powers of Mjolnir?
Is there a drawback to Flail Snail's Shell defense?
Is there such thing as a "3-dimensional surface?"
Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?
Does the length of a password for Wi-Fi affect speed?
Does a 4 bladed prop have almost twice the thrust of a 2 bladed prop?
Is the Folding Boat truly seaworthy?
Secure my password from unsafe servers
Colleagues speaking another language and it impacts work
Pronouns when writing from the point of view of a robot
Is it a bad idea to offer variants of a final exam based on the type of allowed calculators?
Do any languages mention the top limit of a range first?
What is an air conditioner compressor hard start kit and how does it work?
How to approach protecting my code as a research assistant? Should I be worried in the first place?
Can external light meter replace the need for push/pull?
How to realistically deal with a shield user?
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
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
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
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
asked Jul 27 at 20:53
batFINGERbatFINGER
1133 bronze badges
1133 bronze badges
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.
For instance, to get the RGB for the foreground color of pythonComment, you can use the following command:
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
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
Jul 28 at 3:14
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
Jul 28 at 3:28
1
This has got itecho synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
– batFINGER
Jul 28 at 7:08
I didn't know abouthlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.
– filbranden
Jul 28 at 11:31
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.colorsmethods 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
Jul 28 at 2:22
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
);
);
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.
For instance, to get the RGB for the foreground color of pythonComment, you can use the following command:
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
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
Jul 28 at 3:14
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
Jul 28 at 3:28
1
This has got itecho synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
– batFINGER
Jul 28 at 7:08
I didn't know abouthlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.
– filbranden
Jul 28 at 11:31
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.
For instance, to get the RGB for the foreground color of pythonComment, you can use the following command:
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
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
Jul 28 at 3:14
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
Jul 28 at 3:28
1
This has got itecho synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
– batFINGER
Jul 28 at 7:08
I didn't know abouthlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.
– filbranden
Jul 28 at 11:31
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.
For instance, to get the RGB for the foreground color of pythonComment, you can use the following command:
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
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.
For instance, to get the RGB for the foreground color of pythonComment, you can use the following command:
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
edited Jul 28 at 11:33
answered Jul 28 at 2:35
filbrandenfilbranden
1,8273 silver badges14 bronze badges
1,8273 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
Jul 28 at 3:14
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
Jul 28 at 3:28
1
This has got itecho synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
– batFINGER
Jul 28 at 7:08
I didn't know abouthlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.
– filbranden
Jul 28 at 11:31
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
Jul 28 at 3:14
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
Jul 28 at 3:28
1
This has got itecho synIDattr(synIDtrans(hlID("pythonComment")), "fg#")
– batFINGER
Jul 28 at 7:08
I didn't know abouthlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.
– filbranden
Jul 28 at 11:31
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
Jul 28 at 3:14
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
Jul 28 at 3:14
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
Jul 28 at 3:28
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
Jul 28 at 3:28
1
1
This has got it
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")– batFINGER
Jul 28 at 7:08
This has got it
echo synIDattr(synIDtrans(hlID("pythonComment")), "fg#")– batFINGER
Jul 28 at 7:08
I didn't know about
hlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.– filbranden
Jul 28 at 11:31
I didn't know about
hlID(), so glad I learned it from this question, thanks for that! Incorporated it into the answer.– filbranden
Jul 28 at 11:31
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.colorsmethods 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
Jul 28 at 2:22
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.colorsmethods 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
Jul 28 at 2:22
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 Jul 28 at 1:50
answered Jul 28 at 1:45
B LayerB Layer
6,9621 gold badge6 silver badges25 bronze badges
6,9621 gold badge6 silver badges25 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.colorsmethods 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
Jul 28 at 2:22
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.colorsmethods 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
Jul 28 at 2:22
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
Jul 28 at 2:22
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
Jul 28 at 2:22
add a comment |
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