X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FColorSet.h;h=c1de480f4f0b66dd8a2f0cba2572627a110b0e04;hb=26ba2a65838731ce639a09539f617cb0f0be3b22;hp=31e93121bf6fc36502eb22292a660f076c888ff5;hpb=8415041b1f4d7a2e436e3f407bccd9a7e6bcdd87;p=lyx.git diff --git a/src/ColorSet.h b/src/ColorSet.h index 31e93121bf..c1de480f4f 100644 --- a/src/ColorSet.h +++ b/src/ColorSet.h @@ -49,21 +49,39 @@ public: ColorSet(); /** set the given LyX color to the color defined by the X11 hex name given - * \returns true if successful. + * \returns true if successful. The optional third argument passes + * a color for dark mode. */ - bool setColor(ColorCode col, std::string const & x11hexname); + bool setColor(ColorCode col, std::string const & x11hexname, + std::string const & x11darkhexname = std::string()); /** set the given LyX color to the color defined by the X11 * hex name given \returns true if successful. A new color entry - * is created if the color is unknown + * is created if the color is unknown. The optional third argument passes + * a color for dark mode. + */ + bool setColor(std::string const & lyxname, std::string const & x11hexname, + std::string const & x11darkhexname = std::string()); + + /** set the given LyX color to a latexcolor if not yet defined + * \returns true if successful. A new color entry + * is created if the color is unknown. + */ + bool setLaTeXName(std::string const & lyxname, std::string const & latexname); + + /** set the GUI name of a given LyX color to a guiname if not yet defined + * \returns true if successful. */ - bool setColor(std::string const & lyxname, std::string const & x11hexname); + bool setGUIName(std::string const & lyxname, std::string const & guiname); /// Get the GUI name of \c color. docstring const getGUIName(ColorCode c) const; /// Get the X11 hexname of \c color. - std::string const getX11HexName(ColorCode c) const; + std::string const getX11HexName(ColorCode c, bool const darkmode = false) const; + + /// Get the X11 hexname of \c color. + std::pair const getAllX11HexNames(ColorCode c) const; /// Get the LaTeX name of \c color. std::string const getLaTeXName(ColorCode c) const; @@ -88,6 +106,8 @@ private: std::string latexname; /// the name for X11 std::string x11hexname; + /// matching X11 color for dark mode + std::string x11darkhexname; /// the name for LyX std::string lyxname; };