On Fri, 03 Nov 2000, Jean-Marc Lasgouttes wrote:
> Angus, I'll  apply your patch. Note however that it contains lines
> like
>       if( name == "gray0" )   name = "black"
>       if( name == "gray100" ) name = "white"
> which probably do not compile better on your machine than it does on
> mine :) You should probably check that you submitted the right
> version.

Thanks, Jean-Marc.

I did submit the right version. Unfortunately, I succumbed to temptation and 
made one last change and then didn't bother to recompile.

Sorry for the inconvenience.

> A few remarks:

> - the field showing the resulting color is not visible enough (the
>   sliders are more visible, in fact).

I've changed the order to "name r g b". That should be clearer.

> - it would be better not to have the rgb codes visible in the color
>   list. It is distracting.

> - since the colors are fixed to those contained in rgb.txt, would it
>   be possible to force the value of the sliders to the real color (you
>   select the color in the browser, so you could also fix the positions
>   of the sliders).

Well, the colours are NOT fixed to those in rgb.txt. Move the sliders and you 
get the closest approximation to this in the browser. Click on the browser 
entry and the slider adjusts to it.

This way, you don't need to have rgb.txt to select colours. It just helps!

I don't thing the LColor entries need know about the colour name at all. Why 
not just have LColour::color containing a list of coloured elements 
(background, foreground, latex etc) and change LColour::ColorEntry to

        struct ColorEntry {
                LColor::color lcolor;
                string guiname;
                vector<int> rgb(3);
        };

        Eg: (latex, "LaTeX", vector<int>(255,0,0)).

There's no need for LyX to know the actual colour of any of its elements. 
Just the logical colour. LColour::color would become (see bottom).

AND this would clean up an ugly bit of code, moving GUI stuff into the GUI.
Thoughts?
Angus

        enum color {
                // Needed interface colors

                /// Background color
                background,
                /// Foreground color
                foreground,
                /// Background color of selected text
                selection,
                /// Text color in LaTeX mode
                latex,
                /// Titles color of floats
                floats,

                /// Text color for notes
                note,
                /// Background color of notes
                notebg,
                /// Frame color for notes
                noteframe,

                /// Color for the depth bars in the margin
                depthbar,
                /// Color for marking foreign language words
                language,

                /// Text color for command insets
                command,
                /// Background color for command insets
                commandbg,
                /// Frame color for command insets
                commandframe,

                /// Text color for accents we can't handle nicely
                accent,
                ///
                accentbg,
                ///
                accentframe,

                /// Minipage line color
                minipageline,

                /// Special chars text color
                special,

                /// Math inset text color
                math,
                /// Math inset background color
                mathbg,
                /// Math inset frame color
                mathframe,
                /// Math cursor color
                mathcursor,
                /// Math line color
                mathline,

                /// Footnote marker text
                footnote,
                /// Footnote marker background color
                footnotebg,
                /// Footnote line color
                footnoteframe,

                /// ERT marker text
                ert,
                
                /// Text color for inset marker
                inset,
                /// Inset marker background color
                insetbg,
                /// Inset marker frame color
                insetframe,

                /// Error box text color
                error,
                /// EOL marker color
                eolmarker,
                /// Appendix line color
                appendixline,
                /// VFill line color
                vfillline,
                /// Top and bottom line color
                topline,
                /// Table line color
                tableline,
                /// Table line color
                tabularline,
                /// Table line color
                tabularonoffline,
                /// Bottom area color
                bottomarea,
                /// Page break color
                pagebreak,

                /// Color used for top of boxes
                top,
                /// Color used for bottom of boxes
                bottom,
                /// Color used for left side of boxes
                left,
                /// Color used for right side of boxes
                right,
                /// Color used for bottom background
                buttonbg,

                // Logical attributes

                /// Color is inherited
                inherit,
                /// For ignoring updates of a color
                ignore
        };

Reply via email to