aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Bortolli <pedrovbortolli@gmail.com>2019-04-27 12:28:18 -0300
committerJustin M. Keyes <justinkz@gmail.com>2019-04-27 17:28:18 +0200
commit1039e0621d4c23d42d513efdf413d4767db9bccb (patch)
tree1e712eaab7aa9eafd433f302bd7cac40f40cda07
parent920ec8181b2bf7547688ed877252a1f2127db198 (diff)
downloadrneovim-1039e0621d4c23d42d513efdf413d4767db9bccb.tar.gz
rneovim-1039e0621d4c23d42d513efdf413d4767db9bccb.tar.bz2
rneovim-1039e0621d4c23d42d513efdf413d4767db9bccb.zip
doc/API #9916
-rw-r--r--src/nvim/api/vim.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index f54ac5072c..390f1bbddb 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1198,12 +1198,25 @@ void nvim_unsubscribe(uint64_t channel_id, String event)
rpc_unsubscribe(channel_id, e);
}
+/// If the given name is an hexadecimal value (e.g. #XXXXXX)
+/// translates it to RGB. Otherwise, translates given name
+/// (e.g. “Pink”) to its RGB value. Returns -1 if it wasn’t
+/// able to find a correct RGB value for the given color name.
+///
+/// @param name Color name string
+/// @return A 24-bit RGB value of the given name or -1 if it wasn’t able
+/// to find a correct RGB value for the given color name.
Integer nvim_get_color_by_name(String name)
FUNC_API_SINCE(1)
{
return name_to_color((char_u *)name.data);
}
+/// Returns a map (dictionary) with all colors from rgb.txt.
+/// Every key in the map is a color name (e.g. “Aqua”), and every
+/// value is a 24-bit RGB value (e.g. 65535).
+///
+/// @return Map associating names of colors and color RGB values.
Dictionary nvim_get_color_map(void)
FUNC_API_SINCE(1)
{