[LyX/master] Prevent branch background color from leaking out of the document

Jürgen Spitzmüller spitz at lyx.org
Thu Jan 21 09:48:55 UTC 2021

Am Donnerstag, dem 21.01.2021 um 10:41 +0100 schrieb Jean-Marc
> Le 21/01/2021 à 09:55, Jürgen Spitzmüller a écrit :
> > Am Donnerstag, dem 21.01.2021 um 09:52 +0100 schrieb Jean-Marc
> > Lasgouttes:
> > > This is why IMO declaring a name for such colors is a mistake. An
> > > enum value generated on the fly would be enough.
> > 
> > And where would you store and access these enum values?
> The color cache (is that ColorTable?) would give me one (that would
> be 
> an extension of Color_Code) on request (code = 
> colorCache.allocateColor("58bbF7")). The int value would be the id of
> the color in memory. When writing to file, one would get the rgb
> value 
> and write that to file.

How would that work with semantic branch names (e.g. \color
background)? Semantic branch names are essential to support branches
properly in different color themes.

Also, how would you export semantic color names in LaTeX (e.g.
\textcolor{notefontcolor})? Exporting static rgb values strikes me like
a huge step backwards.

> Doesn't it feel a bit complicated?

No. After all, we only handle that internally.

> I agree though that with a loooooong running LyX instance (as some of
> our users have), the handling of allocation (and deallocation) of
> color 
> may get more complicated. I have not thought a lot abpit it, but I 
> suspect that there exists a data structure for that.

Coupling the color table to buffer seems the more sensible approach to

> JMarc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210121/9e173233/attachment.asc>

More information about the lyx-devel mailing list