X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FColor.cpp;h=f4e84aeee1c0087cf013ac279fc763f014e96396;hb=fb12b282f1300123c7f4c7f10525c29cb598e1fe;hp=bcd60eda8e6bc5b23f27df8f9f14036d20796301;hpb=fdaf744c4a92e17a759782afffa5529ef919f5b5;p=lyx.git diff --git a/src/Color.cpp b/src/Color.cpp index bcd60eda8e..f4e84aeee1 100644 --- a/src/Color.cpp +++ b/src/Color.cpp @@ -21,8 +21,7 @@ #include "support/debug.h" #include "support/gettext.h" #include "support/lstrings.h" - -#include +#include "support/lassert.h" #include #include @@ -77,7 +76,7 @@ string const X11hexname(RGBColor const & col) RGBColor rgbFromHexName(string const & x11hexname) { RGBColor c; - BOOST_ASSERT(x11hexname.size() == 7 && x11hexname[0] == '#'); + LASSERT(x11hexname.size() == 7 && x11hexname[0] == '#', /**/); c.r = hexstrToInt(x11hexname.substr(1,2)); c.g = hexstrToInt(x11hexname.substr(3,2)); c.b = hexstrToInt(x11hexname.substr(5,2)); @@ -87,6 +86,10 @@ RGBColor rgbFromHexName(string const & x11hexname) ColorSet::ColorSet() { + char const * grey40 = "#666666"; + char const * grey60 = "#999999"; + char const * grey80 = "#cccccc"; + //char const * grey90 = "#e5e5e5"; // ColorCode, gui, latex, x11, lyx static ColorEntry const items[] = { { Color_none, N_("none"), "none", "black", "none" }, @@ -106,9 +109,9 @@ ColorSet::ColorSet() "selectiontext", "black", "selectiontext" }, { Color_latex, N_("LaTeX text"), "latex", "DarkRed", "latex" }, { Color_inlinecompletion, N_("inline completion"), - "inlinecompletion", "grey60", "inlinecompletion" }, + "inlinecompletion", grey60, "inlinecompletion" }, { Color_nonunique_inlinecompletion, N_("non-unique inline completion"), - "nonuniqueinlinecompletion", "grey80", "nonuniqueinlinecompletion" }, + "nonuniqueinlinecompletion", grey80, "nonuniqueinlinecompletion" }, { Color_preview, N_("previewed snippet"), "preview", "black", "preview" }, { Color_notelabel, N_("note label"), "note", "yellow", "note" }, { Color_notebg, N_("note background"), "notebg", "yellow", "notebg" }, @@ -141,25 +144,25 @@ ColorSet::ColorSet() { Color_mathmacrolabel, N_("Math macro label"), "mathmacrolabel", "#a19992", "mathmacrolabel" }, { Color_mathmacroframe, N_("Math macro frame"), "mathmacroframe", "#ede2d8", "mathmacroframe" }, { Color_mathmacroblend, N_("Math macro blended out"), "mathmacroblend", "black", "mathmacroblend" }, - { Color_mathmacrooldarg, N_("Math macro old parameter"), "mathmacrooldarg", "grey80", "mathmacrooldarg" }, + { Color_mathmacrooldarg, N_("Math macro old parameter"), "mathmacrooldarg", grey80, "mathmacrooldarg" }, { Color_mathmacronewarg, N_("Math macro new parameter"), "mathmacronewarg", "black", "mathmacronewarg" }, { Color_captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" }, { Color_collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" }, { Color_collapsableframe, N_("collapsable inset frame"), "collapsableframe", "IndianRed", "collapsableframe" }, - { Color_insetbg, N_("inset background"), "insetbg", "grey80", "insetbg" }, + { Color_insetbg, N_("inset background"), "insetbg", grey80, "insetbg" }, { Color_insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" }, { Color_error, N_("LaTeX error"), "error", "Red", "error" }, { Color_eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" }, { Color_appendix, N_("appendix marker"), "appendix", "Brown", "appendix" }, { Color_changebar, N_("change bar"), "changebar", "Blue", "changebar" }, - { Color_deletedtext, N_("Deleted text"), "deletedtext", "red", "deletedtext" }, - { Color_addedtext, N_("Added text"), "addedtext", "blue", "addedtext" }, + { Color_deletedtext, N_("Deleted text"), "deletedtext", "#ff0000", "deletedtext" }, + { Color_addedtext, N_("Added text"), "addedtext", "#0000ff", "addedtext" }, { Color_added_space, N_("added space markers"), "added_space", "Brown", "added_space" }, { Color_topline, N_("top/bottom line"), "topline", "Brown", "topline" }, { Color_tabularline, N_("table line"), "tabularline", "black", "tabularline" }, { Color_tabularonoffline, N_("table on/off line"), "tabularonoffline", "LightSteelBlue", "tabularonoffline" }, - { Color_bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" }, + { Color_bottomarea, N_("bottom area"), "bottomarea", grey40, "bottomarea" }, { Color_newpage, N_("new page"), "newpage", "Blue", "newpage" }, { Color_pagebreak, N_("page break / line break"), "pagebreak", "RoyalBlue", "pagebreak" }, { Color_buttonframe, N_("frame of button"), "buttonframe", "#dcd2c8", "buttonframe" }, @@ -233,16 +236,14 @@ bool ColorSet::setColor(ColorCode col, string const & x11name) { InfoTab::iterator it = infotab.find(col); if (it == infotab.end()) { - lyxerr << "Color " << col << " not found in database." - << endl; + LYXERR0("Color " << col << " not found in database."); return false; } // "inherit" is returned for colors not in the database // (and anyway should not be redefined) if (col == Color_none || col == Color_inherit || col == Color_ignore) { - lyxerr << "Color " << getLyXName(col) - << " may not be redefined" << endl; + LYXERR0("Color " << getLyXName(col) << " may not be redefined."); return false; } @@ -276,8 +277,8 @@ ColorCode ColorSet::getFromLyXName(string const & lyxname) const string const lcname = ascii_lowercase(lyxname); Transform::const_iterator it = lyxcolors.find(lcname); if (it == lyxcolors.end()) { - lyxerr << "ColorSet::getFromLyXName: Unknown color \"" - << lyxname << '"' << endl; + LYXERR0("ColorSet::getFromLyXName: Unknown color \"" + << lyxname << '"'); return Color_none; }