Hi all,

This patch customizes the color of the greyed-out-notes.

Ok ?

Vincent
diff --git a/src/Color.cpp b/src/Color.cpp
index 79953e3..66b5157 100644
--- a/src/Color.cpp
+++ b/src/Color.cpp
@@ -159,6 +159,7 @@ ColorSet::ColorSet()
        { Color_commentbg, N_("comment background"), "commentbg", "linen", 
"commentbg" },
        { Color_greyedoutlabel, N_("greyedout inset label"), "greyedout", 
"#ff0080", "greyedout" },
        { Color_greyedoutbg, N_("greyedout inset background"), "greyedoutbg", 
"linen", "greyedoutbg" },
+       { Color_greyedout_output, N_("greyedout in output"), 
"greyedout_output", grey80, "greyedout_output" },
        { Color_phantomtext, N_("phantom inset text"), "phantomtext", 
"#7f7f7f", "phantomtext" },
        { Color_shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
        { Color_listingsbg, N_("listings background"), "listingsbg", "white", 
"listingsbg" },
diff --git a/src/ColorCode.h b/src/ColorCode.h
index 16e0ba3..c082a08 100644
--- a/src/ColorCode.h
+++ b/src/ColorCode.h
@@ -67,6 +67,8 @@ enum ColorCode
        Color_greyedoutlabel,
        /// Background color of greyedout inset
        Color_greyedoutbg,
+       /// Output color of greyedout inset
+       Color_greyedout_output,
        /// Background color of shaded box
        Color_shadedbg,
        /// Background color of listings inset
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 99a7d81..0037554 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -155,7 +155,8 @@ static string const tabularnewline_def =
        
 static string const lyxgreyedout_def =
        "%% The greyedout annotation environment\n"
-       
"\\newenvironment{lyxgreyedout}{\\textcolor[gray]{0.8}\\bgroup}{\\egroup}\n";
+       "\\newenvironment{lyxgreyedout}"
+       "{\\textcolor{lyxgreyedoutcolor}\\bgroup}{\\egroup}\n";
 
 // We want to omit the file extension for includegraphics, but this does not
 // work when the filename contains other dots.
@@ -807,8 +808,21 @@ string const LaTeXFeatures::getMacros() const
                macros << tabularnewline_def;
 
        // greyedout environment (note inset)
-       if (mustProvide("lyxgreyedout"))
+       if (mustProvide("lyxgreyedout") && mustProvide("color")) {
                macros << lyxgreyedout_def;
+               RGBColor const cgreyed_out = 
+                       
rgbFromHexName(lcolor.getX11Name(Color_greyedout_output));
+               unsigned int value = 0;
+               if (cgreyed_out.r > value)
+                       value = cgreyed_out.r;
+               if (cgreyed_out.g > value)
+                       value = cgreyed_out.g;
+               if (cgreyed_out.b > value)
+                       value = cgreyed_out.b;
+                       
+               macros << "\\definecolor{lyxgreyedoutcolor}{gray}{"
+                      << value / 255.0 << "}\n";
+       }
 
        if (mustProvide("lyxdot"))
                macros << lyxdot_def << '\n';

Reply via email to