You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Regina Henschel <rb...@t-online.de> on 2014/10/22 20:52:35 UTC
color names in Math
Hi all,
I'm going to work on https://issues.apache.org/ooo/show_bug.cgi?id=118191.
ODF1.2 uses MathML and that allows font colors to be defined by
html-color-names. The corresponding rgb-values are defined in HTML.
The problems are:
Math writes its "red" as "red" in mml and renders it as rgb 80 00 00.
But "red" in HTML is defined as FF 00 00. The dark variant is named
"maroon".
Math writes its "blue" as "blue" in mml and renders it as rgb 00 00 80.
But "blue" in HTML is defined as rgb 00 00 FF. The dark variant is named
"navy".
Math writes its "cyan" as "aqua" in mml and renders it as rgb 00 80 80.
But "aqua" in HTML is defined as rgb 00 FF FF. The dark variant is named
"teal". A color name "cyan" does not exist as html-color-name.
Math writes its "magenta" as "fuchsia" in mml and renders it as rbg 80
00 80. But "fuchsia" in HTML is defined as rgb FF 00 FF. The dark
variant is named "purple". A color name "magenta" does not exist as
html-color-name.
So in each case the rendering is different from the value in the file.
If you get a foreign document or a pur MathML formula for import, which
have no annotation containing the Starmath expression, then it is
rendered wrongly.
I see two options in general
(a) change rendering to the rgb-values of the html-color-names contained
in the file.
(b) change file export to write html-color-names which meet the rendering.
In addition, as more colors in Math is a very old wish, I want to add
the missing html-color-name colors in this fix, so that it is possible
to use 16 colors instead of only 8 colors now. That would not solve
https://issues.apache.org/ooo/show_bug.cgi?id=5156 totally but would
help. For #rgb and ##rrggbb colors I would have to learn more about the
code to solve it.
Suggestions, ideas, concerns?
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi,
find a color table in https://wiki.openoffice.org/wiki/User:Regina/MYDrafts6
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi Kay,
Kay Schenk schrieb:
[..]
> Hi Regina --
>
> I saw that you had already made some changes yesterday re i118191
>
> https://issues.apache.org/ooo/show_bug.cgi?id=118191
Yes, that is finished technically.
>
> I have not investigated color renderings in AOO at all in terms of values,
> but my first thought is we should be consistent across modules on how this
> is done. RGB vs HTML?
HTML uses RGB in form of the unique #rrggbb syntax. The problem is not
RGB but the color names, which are allowed in addition.
Calc uses color names in the number format codes. These names are
localized. In the file format, only the unique #rrggbb values are
written. The number format codes are not standardized in ODF.
In Draw and in all other places where color palettes are used, the color
names are user defined and stored in the palettes in the user profile.
In file format the unique numerical #rrggbb values are used.
But .odf documents are standardized in ODF to use MathML and for MathML
color names are allowed as defined in
http://www.w3.org/TR/REC-html40/types.html#h-6.5. But StarMath uses
values as defined in
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/tools/inc/tools/color.hxx
and names, which might be based on cga. This results in the current
mismatch. StarMath is not part of ODF.
Therefore only a solution for module Math is needed.
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
RE: color names in Math
Posted by "Dennis E. Hamilton" <de...@acm.org>.
-----Original Message-----
From: Kay Schenk [mailto:kay.schenk@gmail.com]
Sent: Tuesday, October 28, 2014 17:02
To: dev@openoffice.apache.org
Subject: Re: color names in Math
On 10/28/2014 03:25 PM, Regina Henschel wrote:
> Hi Kay,
>
> Kay Schenk schrieb:
>> On Mon, Oct 27, 2014 at 8:27 AM, Regina Henschel
>> <rb...@t-online.de>
>> wrote:
>>
>>> Hi Kay,
>>>
>>> Kay Schenk schrieb:
>>>
>>>>
>>>> Hi Regina --
>>>>
>>>> I saw that you had already made some changes yesterday re i118191
>>>>
>>>> https://issues.apache.org/ooo/show_bug.cgi?id=118191
>>>>
>>>> I have not investigated color renderings in AOO at all in terms of
>>>> values,
>>>> but my first thought is we should be consistent across modules on
>>>> how this
>>>> is done. RGB vs HTML?
>>>>
>>>
>>> I have compared Calc to StarMath to HTML in the attachments. There is
>>> currently no consistence between Calc and Math.
>>>
>>> Kind regards
>>> Regina
>>>
>>
>> Thanks for your research. I started thinking maybe making these
>> consistent
>> across all modules (really I have not looked into this yet), would be a
>> good "easy" fix for a new volunteer. What do you think?
>
> For module Math it is too late to make it an "easy" fix, because the fix
> is finished, beside the question, what color to use. When I started I
> had no idea how easy or hard it would be.
Right, I saw your changes but didn't evaluate the extent.
>
> For Calc I have looked around, but could not find the place yet. So if
> someone can provide a pointer, then it might work. But I'm not sure
> because localization is involved.
>
> Back to the question, which color to use:
> Foreign (not OpenOffice or LibreOffice) .odf documents will use the
> html-color-names and those names are standardized. So for that names I
> think, there is no choice, we have to render them as they are defined in
> the standard. Do you agree?
Of course, we have to use what is defined in the standard.
>
> So the color name "red" will be #ff0000 in Math as it is already in
> Calc, and the color name "blue" will be #0000ff in Math as it is already
> in Calc. That gives a more consistent use and solves issue i118191. But
> old documents will be rendered different.
>
> The color name green in Math has the same rendering as green in html, so
> that can stay. For Calc it can be solved, when the color name "lime" is
> allowed too and mapped to the light green and "green" to the dark green.
> Color names are not stored in the Calc files and therefore old documents
> are not affected.
>
> The question is, what to do with names "cyan" and "magenta"? These names
> do not belong to the standard. So we can decide, which color OpenOffice
> renders and which color it writes to the file. If Math will use them the
> same way as Calc, then "cyan" has to be rendered same as "aqua" and
> "magenta" same as "fuchsia". OpenOffice writes currently "aqua" and
> "fuchsia" to the MathML part of the file already. That would make the
> names consistent between Math and Calc and between rendering via
> StarMath and rendering via pure MathML. But old documents would be
> rendered different. Shall I change the rendering of "cyan" and "magenta"
> to the light colors too?
Personally, I would make them consistent from this day forward, so I
would say "yes" make MathML the same as Calc.
I just found this reference area for color codes/names--
http://www.rapidtables.com/web/color/cyan-color.htm
cyan = aqua in rgb
http://www.rapidtables.com/web/color/purple-color.htm
same for magenta = fuchsia
Others may have a different opinion though.
<orcnote>
I've lost track, here, of what is recorded in the ODF file as a color
choice (in MathML and in other places where there are color choices)
and what is presented to the user as the name for the color (also on
any drop-down from a sample of the color in a color-picker).
Another place to figure out what is going on is the colors that were
implemented beyond the 16 standard RGB names in HTML/XHTML. In that
case, cyan is the same as cyan1 (and aqua) and magenta is the same as
fuschia - that is, they are the brightest forms of the
colors. Another way of looking at it: cyan/aqua is the complement of
red, magenta/fuschia is the complement of green.
</orcnote>
>
> Kind regards
> Regina
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
--
-------------------------------------------------------------------------
MzK
"One must still have chaos in oneself to be able to give birth
to a dancing star."
-- Friedrich Nietzsche
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
RE: color names in Math
Posted by "Dennis E. Hamilton" <de...@acm.org>.
Regina,
Thanks for the detailed analysis. This is definitely a very messy situation.
Notes below.
-----Original Message-----
From: Regina Henschel [mailto:rb.henschel@t-online.de]
Sent: Saturday, November 8, 2014 12:32
To: dev@openoffice.apache.org
Subject: Re: color names in Math
Hi Dennis,
some corrections :( Read my other mail too.
Dennis E. Hamilton schrieb:
> Fascinating. So there is basically an interoperability bug between the Starmath code and the MathML RGB coding.
Yes.
[..]
>
> <orcnote>
> In the OpenFormula specification of ODF 1.2, the TEXT function format
> code is left as implementation-defined. That raises two obligations
> it seems to me:
>
> 1. "Implementation-Defined" means the OpenOffice definition must
> be published in some easily-found form that others can consult for
> testing, verification, and determination of interoperability cases.
The only reference I know is the in-build help.
<orcnote>
I could only find two examples under TEXT function. I tried some
of the formats under Number Format Codes and I could not make a
TEXT with Format work at all, using AOO 4.1.1 on Windows 8.1 x64.
</orcnote>
> Assuming that the TextFormatCode text value cannot be taken from a
> cell reference
A reference to a cell is possible.
<orcnote>
Oh, I read the ODF 1.2 Part 2 6.20.23 incorrectly. So it is Format
Code and it is any expression that produces a text value. So yes,
References are possible.
OK, then rewriting between the user and the document format is not
useful, since these can be from the values in other cells. So that
also means any international variations have to all be accepted by
an OpenFormula consumer with the same implementation-defined
FormatCode cases.
</orcnote>
[ ... ]
>
> 2. It also means that the definition by other implementations of
> OpenFormula need to be considered. The obvious ones that come to
> mind are the Excel support for ODF OpenFormula, the support in
> Gnumerics, and of course LibreOffice. All of these implementations
> are expected to publish their definitions for TextFormatCode values,
> and some cooperation would be valuable in this context.
> </orcnote>
That might be better discussed in the ODF TC. Perhaps the OASIS Wiki
would be a good place to collect such information - with the constantly
recurring question, who will do it?
<orcnote>
Only Members of the ODF TC can create content on the OASIS Wiki for
the ODF TC. Also, I think only members can create JIRA issues.
They are readable in public, but not writable by anyone but the TC.
</orcnote>
[ ... ]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi Dennis,
some corrections :( Read my other mail too.
Dennis E. Hamilton schrieb:
> Fascinating. So there is basically an interoperability bug between the Starmath code and the MathML RGB coding.
Yes.
>
> Notes below.
I snipped some in-between text to make it a bit shorter.
[..]
> Andrea Pescetti schrieb:
>> On 29/10/2014 Regina Henschel wrote:
> [ ... ]
>
> OpenOffice has written "red" to StarMath code in the <annotation>
> element and #ff0000 to the MathML part. That is the correct mapping. But
> in rendering, OpenOffice has not shown the color #ff0000 but the color
> #800000.
Correction: OpenOffice writes "red" not #ff0000.
> Would this ensure less equivocal compatibility with the
>> standards and other suites?
>
> <orcnote>
> It seems using #RGB codings is the reliable way to interchange
> since it does not depend on discrepancies in the names given to the
> codes. It even avoids internationalization issues.
> </orcnote>
I think so too. But that is difficult with the StarMath language.
>
>
> Writing #rrggbb values in StarMath would make it unambiguous.
>
> I hesitate to start in that direction. It needs an own discussion (new
> thread) about the future of StarMath. Perhaps we should go in the same
> direction as with the old binary formats and drop it totally. MathML is
> much richer than the existing StarMath language. To be able to really
> use MathML 2.0, the StarMath language would have to be extended and who
> will do that? I have not even found a specification of the language.
>
> <orcnote>
> It strikes me that the way to deal with the "red" disparity is to
> have #800000" written in the MathML where Starmath "red" is intend
> and to not include the StarMath code.
>
> On re-imput to OpenOffice, or to the StarMath, the name can then be
> properly re-derived from the #RGB. So StarMath "red" is not broken,
> interop with the correct color happens. Except for the problem below.
> </orcnote>
You are right. It was my error. OpenOffice writes "red".
>
> Would colors written this way be properly
>> remapped to their names when reopening the file?
>
> The mapping is already done in case the annotation is missing, the value
> #ff0000 is mapped to StarMath "red", but "red" has been rendered as #800000.
>
> <orcnote>
> This mapping #ff0000" to StarMath "red" is definitely a bug. Does
> StarMath have no color-name equivalent for #ff0000?" Does it have
> similar problems for the other primaries, #00ff00 and #0000ff?
>
> If the problem is that StarMath has limited color choices, there is
> a significant problem having that interfere with interop of
> ODF documents having MathML.
> </orcnote>
See above OpenOffice writes "red".
StarMath has no color-name equivalent for #ff0000.
The same error is in "blue". The StarMath blue is indead a "#000080".
StarMath has no color-name equivalent for #0000ff.
The primary #00ff00 is called "lime". StarMath has no color-name for it.
The StarMath "green" is a "#008000" and that is the same as the MathML
"green"
StarMath has the color-names "cyan" and "magenta", which do not exist in
MathML.
[..]
>
> <orcnote>
> In the OpenFormula specification of ODF 1.2, the TEXT function format
> code is left as implementation-defined. That raises two obligations
> it seems to me:
>
> 1. "Implementation-Defined" means the OpenOffice definition must
> be published in some easily-found form that others can consult for
> testing, verification, and determination of interoperability cases.
The only reference I know is the in-build help.
> Assuming that the TextFormatCode text value cannot be taken from a
> cell reference
A reference to a cell is possible.
, there is no internationalization problem, since
> Calc can translate other-language expressions to a single code, if
> desired. If a cell-carried or formula-derived text value is (ever)
> allowed, support for names here becomes more difficult. (Note: This
> is not about what OpenOffice Calc shows to users or allows to be
> entered, but what is actually conveyed in the file. Ideally, there
> is some harmony though.)
As far as I see, the number format code is not written to file format,
in case it is used in a style. But all properties are transformed into
ODF attributes. For example the color [BLUE] in the number format code
in the UI becomes a fo:color="#0000ff" in the file.
There is no issue with color names in the TEXT function as I have tested
yet. The color in the format code is ignored in case of the TEXT
function. [I should be more careful and really test all.]
>
> 2. It also means that the definition by other implementations of
> OpenFormula need to be considered. The obvious ones that come to
> mind are the Excel support for ODF OpenFormula, the support in
> Gnumerics, and of course LibreOffice. All of these implementations
> are expected to publish their definitions for TextFormatCode values,
> and some cooperation would be valuable in this context.
> </orcnote>
That might be better discussed in the ODF TC. Perhaps the OASIS Wiki
would be a good place to collect such information - with the constantly
recurring question, who will do it?
>
>
> From some strange code, which translates between German and English
> color names, I guess that color names were perhaps used in StarOffice
> binary formats.
>
>>
>>> older OpenOffice versions don't know "teal" and will show a ?.
>>
>> This is important for the Release notes too. And would it be the same if
>> we write the color as RGB?
>
> Yes, #rrggbb notation would result in ? too. The StarMath parser in
> older versions is not able to parse #rrggbb notation in StarMath code.
>
> <orcnote>
> What is the oldest OpenOffice.org version where the StarMath parser
> Can handle #RGB codings?
> </orcnote>
My error, see above and the other mail. StarMath parser can only handle
color names.
PowerPoint 2010 imports .odp with Math-objects which have the 16 color
names and those which have #rrggbb values as well.
OpenOffice has to be improved in the Math-module. But upholding StarMath
might not be the best solution.
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
RE: color names in Math
Posted by "Dennis E. Hamilton" <de...@acm.org>.
Fascinating. So there is basically an interoperability bug between the Starmath code and the MathML RGB coding.
Notes below.
-----Original Message-----
From: Regina Henschel [mailto:rb.henschel@t-online.de]
Sent: Saturday, November 8, 2014 05:20
To: dev@openoffice.apache.org
Subject: Re: color names in Math
Hi Andrea,
Andrea Pescetti schrieb:
> On 29/10/2014 Regina Henschel wrote:
[ ... ]
OpenOffice has written "red" to StarMath code in the <annotation>
element and #ff0000 to the MathML part. That is the correct mapping. But
in rendering, OpenOffice has not shown the color #ff0000 but the color
#800000.
>
> I agree with your proposals on how to handle the broken color mapping.
>
> Is it feasible to switch to writing the RGB values to the file instead
> of color names?
I have looked at it, for to be able to use the #rgb and #rrggbb
notations, which are allowed in MathML. My idea was to allow such
notations in StarMath too. But that is a larger task and has a lot of
problems. For example the current implementation of the StarMath parser
handles all content as tokens, but does not keep the context of the
tokens. So the hash # is turned to a token TPOUND. And for #00ff00 the
next token would be TNUMBER, but for #ff0000 the next token would be
TIDENT (=identifier). As # is used as delimiter in matrix and stack, the
context is needed to handle # different, when it follows a color command.
In the import filter for MathML it is no problem. There the token for
color has the complete value #00ff00 (for example) as token value and it
would be possible to write the correct color value into the node of the
model.
Would this ensure less equivocal compatibility with the
> standards and other suites?
<orcnote>
It seems using #RGB codings is the reliable way to interchange
since it does not depend on discrepancies in the names given to the
codes. It even avoids internationalization issues.
</orcnote>
Writing #rrggbb values in StarMath would make it unambiguous.
I hesitate to start in that direction. It needs an own discussion (new
thread) about the future of StarMath. Perhaps we should go in the same
direction as with the old binary formats and drop it totally. MathML is
much richer than the existing StarMath language. To be able to really
use MathML 2.0, the StarMath language would have to be extended and who
will do that? I have not even found a specification of the language.
<orcnote>
It strikes me that the way to deal with the "red" disparity is to
have #800000" written in the MathML where Starmath "red" is intend
and to not include the StarMath code.
On re-imput to OpenOffice, or to the StarMath, the name can then be
properly re-derived from the #RGB. So StarMath "red" is not broken,
interop with the correct color happens. Except for the problem below.
</orcnote>
Would colors written this way be properly
> remapped to their names when reopening the file?
The mapping is already done in case the annotation is missing, the value
#ff0000 is mapped to StarMath "red", but "red" has been rendered as #800000.
<orcnote>
This mapping #ff0000" to StarMath "red" is definitely a bug. Does
StarMath have no color-name equivalent for #ff0000?" Does it have
similar problems for the other primaries, #00ff00 and #0000ff?
If the problem is that StarMath has limited color choices, there is
a significant problem having that interfere with interop of
ODF documents having MathML.
</orcnote>
If I read correctly,
> you said that this is what Calc does, and it looks much less error-prone.
The color names do not exist in ODF file format, but file format uses
#rrggbb values directly. So there is no problem with definitions made in
Format > Cell > Numbers.
The problem in Calc is, that it is possible to use a format code as
string in the function TEXT and so the color names can be used indirectly.
<orcnote>
In the OpenFormula specification of ODF 1.2, the TEXT function format
code is left as implementation-defined. That raises two obligations
it seems to me:
1. "Implementation-Defined" means the OpenOffice definition must
be published in some easily-found form that others can consult for
testing, verification, and determination of interoperability cases.
Assuming that the TextFormatCode text value cannot be taken from a
cell reference, there is no internationalization problem, since
Calc can translate other-language expressions to a single code, if
desired. If a cell-carried or formula-derived text value is (ever)
allowed, support for names here becomes more difficult. (Note: This
is not about what OpenOffice Calc shows to users or allows to be
entered, but what is actually conveyed in the file. Ideally, there
is some harmony though.)
2. It also means that the definition by other implementations of
OpenFormula need to be considered. The obvious ones that come to
mind are the Excel support for ODF OpenFormula, the support in
Gnumerics, and of course LibreOffice. All of these implementations
are expected to publish their definitions for TextFormatCode values,
and some cooperation would be valuable in this context.
</orcnote>
From some strange code, which translates between German and English
color names, I guess that color names were perhaps used in StarOffice
binary formats.
>
>> older OpenOffice versions don't know "teal" and will show a ?.
>
> This is important for the Release notes too. And would it be the same if
> we write the color as RGB?
Yes, #rrggbb notation would result in ? too. The StarMath parser in
older versions is not able to parse #rrggbb notation in StarMath code.
<orcnote>
What is the oldest OpenOffice.org version where the StarMath parser
Can handle #RGB codings?
</orcnote>
Kind regards
Regina
<orcnote>
Thanks for the meticulous analysis, Regina.
I wonder if some of the disconnection here has to do with cases where
the commitment to ODF as the primary format has been compromised.
The inconsistencies are going to be a problem if there is to be greater
ODF compliance and interoperability going forward, especially in those
places where ODF has been made a preferred format. Those selections are
not with concern for OpenOffice.org's StarOffice heritage but for the
interoperability and substitutability assurances that is presumed for
ODF compliance.
</orcnote>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
I should not write answers on the fly. I apologize, I have to correct
some parts.
Regina Henschel schrieb:
>
> OpenOffice has written "red" to StarMath code in the <annotation>
> element and #ff0000 to the MathML part. That is the correct mapping. But
> in rendering, OpenOffice has not shown the color #ff0000 but the color
> #800000.
Not the #rrggbb values are written to MathML but the color names. But
those color names have a specified meaning in MathML. OpenOffice uses
for StarMath <-> MathML
white <-> white
black <-> black
yellow <-> yellow
green <-> green
red <-> red [different rendering in OpenOffice and MathML]
blue <-> blue [different rendering in OpenOffice and MathML]
cyan <-> aqua [different rendering in OpenOffice and MathML]
magenta <-> fuchsia [different rendering in OpenOffice and MathML]
> The mapping is already done in case the annotation is missing, the value
> #ff0000 is mapped to StarMath "red", but "red" has been rendered as
> #800000.
Wrong :( #rrggbb values are not imported but only the color names, using
mapping above. Only Calc uses #rrggbb values.
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi Andrea,
Andrea Pescetti schrieb:
> On 29/10/2014 Regina Henschel wrote:
>> ... https://issues.apache.org/ooo/show_bug.cgi?id=118191
>> You are right in that older documents will now have a light color where
>> they had a dark color before. But now not only 8 but all 16 basic html
>> colors will be supported, so the user can change the color name to
>> "teal" if he really wants the dark color. However older OpenOffice
>> versions don't know "teal" and will show a ?.
>> If the solution were obvious, I would not have brought it to the list.
>
> Thanks for the very detailed explanation. This is surely material for
> the next Release Notes. I didn't have time to follow this when you were
> working on it, so please forgive me if I missed some details.
>
> So (limiting this to Math for the moment) we will get 16 color choices
> instead of 8
yes
, but some colors in older documents will now be rendered
> differently due to the fact that we were writing colors in the file by
> name, but we weren't respecting the name attributions in MathML (so we
> used to write "red" for denoting a color that MathML did not call "red").
ODF specification simple says "The <math:math> element serves as a
container for content defined by the MathML 2.0 standard." To keep the
old StarMath syntax the <annotation> element of MathML is used. So when
saving a formula OpenOffice writes MathML code, which is needed for ODF
and in addition it writes an <annotation> element to preserve its own
StarMath code. When reading a file and such <annotation> element exists,
then it is used and MathML is ignored. When such <annotation> element
does not exist, then the MathML code is used.
OpenOffice has written "red" to StarMath code in the <annotation>
element and #ff0000 to the MathML part. That is the correct mapping. But
in rendering, OpenOffice has not shown the color #ff0000 but the color
#800000.
>
> I agree with your proposals on how to handle the broken color mapping.
>
> Is it feasible to switch to writing the RGB values to the file instead
> of color names?
I have looked at it, for to be able to use the #rgb and #rrggbb
notations, which are allowed in MathML. My idea was to allow such
notations in StarMath too. But that is a larger task and has a lot of
problems. For example the current implementation of the StarMath parser
handles all content as tokens, but does not keep the context of the
tokens. So the hash # is turned to a token TPOUND. And for #00ff00 the
next token would be TNUMBER, but for #ff0000 the next token would be
TIDENT (=identifier). As # is used as delimiter in matrix and stack, the
context is needed to handle # different, when it follows a color command.
In the import filter for MathML it is no problem. There the token for
color has the complete value #00ff00 (for example) as token value and it
would be possible to write the correct color value into the node of the
model.
Would this ensure less equivocal compatibility with the
> standards and other suites?
Writing #rrggbb values in StarMath would make it unambiguous.
I hesitate to start in that direction. It needs an own discussion (new
thread) about the future of StarMath. Perhaps we should go in the same
direction as with the old binary formats and drop it totally. MathML is
much richer than the existing StarMath language. To be able to really
use MathML 2.0, the StarMath language would have to be extended and who
will do that? I have not even found a specification of the language.
Would colors written this way be properly
> remapped to their names when reopening the file?
The mapping is already done in case the annotation is missing, the value
#ff0000 is mapped to StarMath "red", but "red" has been rendered as #800000.
If I read correctly,
> you said that this is what Calc does, and it looks much less error-prone.
The color names do not exist in ODF file format, but file format uses
#rrggbb values directly. So there is no problem with definitions made in
Format > Cell > Numbers.
The problem in Calc is, that it is possible to use a format code as
string in the function TEXT and so the color names can be used indirectly.
From some strange code, which translates between German and English
color names, I guess that color names were perhaps used in StarOffice
binary formats.
>
>> older OpenOffice versions don't know "teal" and will show a ?.
>
> This is important for the Release notes too. And would it be the same if
> we write the color as RGB?
Yes, #rrggbb notation would result in ? too. The StarMath parser in
older versions is not able to parse #rrggbb notation in StarMath code.
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Andrea Pescetti <pe...@apache.org>.
On 29/10/2014 Regina Henschel wrote:
> ... https://issues.apache.org/ooo/show_bug.cgi?id=118191
> You are right in that older documents will now have a light color where
> they had a dark color before. But now not only 8 but all 16 basic html
> colors will be supported, so the user can change the color name to
> "teal" if he really wants the dark color. However older OpenOffice
> versions don't know "teal" and will show a ?.
> If the solution were obvious, I would not have brought it to the list.
Thanks for the very detailed explanation. This is surely material for
the next Release Notes. I didn't have time to follow this when you were
working on it, so please forgive me if I missed some details.
So (limiting this to Math for the moment) we will get 16 color choices
instead of 8, but some colors in older documents will now be rendered
differently due to the fact that we were writing colors in the file by
name, but we weren't respecting the name attributions in MathML (so we
used to write "red" for denoting a color that MathML did not call "red").
I agree with your proposals on how to handle the broken color mapping.
Is it feasible to switch to writing the RGB values to the file instead
of color names? Would this ensure less equivocal compatibility with the
standards and other suites? Would colors written this way be properly
remapped to their names when reopening the file? If I read correctly,
you said that this is what Calc does, and it looks much less error-prone.
> older OpenOffice versions don't know "teal" and will show a ?.
This is important for the Release notes too. And would it be the same if
we write the color as RGB?
Regards,
Andrea.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi Marcus,
Marcus schrieb:
[..]
>
> Another thing is to take the compatibility to older documents into account.
>
> When changing the colors so that they look like the user would expect
> due to the standard, then OK. But if this means also that colors in
> older documents will now look different, then ... hm ... it needs to be
> investigated how bad it really would be.
I think, that the current situation is bad for "cyan" (and for "magenta"
as well), because
(1) The user writes "cyan" in Math. Rendering is "teal" as long as
StarMath is used, but in the included MathML - which is the only part
relevant for ODF - the color "aqua" is written.
(2) The user imports a .mml file with "aqua" and gets a rendering of "teal".
(3) The user writes "cyan" in number-format-code in Calc and it is
rendered as "aqua".
My suggestion is, to always handle "cyan" as "aqua". This would also be
in line with how these words are handled by the W3C, e.g.
http://www.w3.org/TR/SVG/types.html#ColorKeywords
The other option would be, that I write "teal" to MathML when the user
writes "cyan". That would solve the conflict between StarMath and
MathML. But that would be inconsistent to the use of the color name
"cyan" in Calc and to other places in the web.
You are right in that older documents will now have a light color where
they had a dark color before. But now not only 8 but all 16 basic html
colors will be supported, so the user can change the color name to
"teal" if he really wants the dark color. However older OpenOffice
versions don't know "teal" and will show a ?.
If the solution were obvious, I would not have brought it to the list.
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Marcus <ma...@wtnet.de>.
Am 10/29/2014 01:02 AM, schrieb Kay Schenk:
> On 10/28/2014 03:25 PM, Regina Henschel wrote:
>> Hi Kay,
>>
>> Kay Schenk schrieb:
>>> On Mon, Oct 27, 2014 at 8:27 AM, Regina Henschel
>>> <rb...@t-online.de>
>>> wrote:
>>>
>>>> Hi Kay,
>>>>
>>>> Kay Schenk schrieb:
>>>>
>>>>>
>>>>> Hi Regina --
>>>>>
>>>>> I saw that you had already made some changes yesterday re i118191
>>>>>
>>>>> https://issues.apache.org/ooo/show_bug.cgi?id=118191
>>>>>
>>>>> I have not investigated color renderings in AOO at all in terms of
>>>>> values,
>>>>> but my first thought is we should be consistent across modules on
>>>>> how this
>>>>> is done. RGB vs HTML?
>>>>>
>>>>
>>>> I have compared Calc to StarMath to HTML in the attachments. There is
>>>> currently no consistence between Calc and Math.
>>>>
>>>> Kind regards
>>>> Regina
>>>>
>>>
>>> Thanks for your research. I started thinking maybe making these
>>> consistent
>>> across all modules (really I have not looked into this yet), would be a
>>> good "easy" fix for a new volunteer. What do you think?
>>
>> For module Math it is too late to make it an "easy" fix, because the fix
>> is finished, beside the question, what color to use. When I started I
>> had no idea how easy or hard it would be.
>
> Right, I saw your changes but didn't evaluate the extent.
>
>>
>> For Calc I have looked around, but could not find the place yet. So if
>> someone can provide a pointer, then it might work. But I'm not sure
>> because localization is involved.
>>
>> Back to the question, which color to use:
>> Foreign (not OpenOffice or LibreOffice) .odf documents will use the
>> html-color-names and those names are standardized. So for that names I
>> think, there is no choice, we have to render them as they are defined in
>> the standard. Do you agree?
>
> Of course, we have to use what is defined in the standard.
sure, I see this as a rethorical question. ;-)
>> So the color name "red" will be #ff0000 in Math as it is already in
>> Calc, and the color name "blue" will be #0000ff in Math as it is already
>> in Calc. That gives a more consistent use and solves issue i118191. But
>> old documents will be rendered different.
>>
>> The color name green in Math has the same rendering as green in html, so
>> that can stay. For Calc it can be solved, when the color name "lime" is
>> allowed too and mapped to the light green and "green" to the dark green.
>> Color names are not stored in the Calc files and therefore old documents
>> are not affected.
>>
>> The question is, what to do with names "cyan" and "magenta"? These names
>> do not belong to the standard. So we can decide, which color OpenOffice
>> renders and which color it writes to the file. If Math will use them the
>> same way as Calc, then "cyan" has to be rendered same as "aqua" and
>> "magenta" same as "fuchsia". OpenOffice writes currently "aqua" and
>> "fuchsia" to the MathML part of the file already. That would make the
>> names consistent between Math and Calc and between rendering via
>> StarMath and rendering via pure MathML. But old documents would be
>> rendered different. Shall I change the rendering of "cyan" and "magenta"
>> to the light colors too?
>
> Personally, I would make them consistent from this day forward, so I
> would say "yes" make MathML the same as Calc.
>
> I just found this reference area for color codes/names--
>
> http://www.rapidtables.com/web/color/cyan-color.htm
> cyan = aqua in rgb
>
> http://www.rapidtables.com/web/color/purple-color.htm
> same for magenta = fuchsia
>
> Others may have a different opinion though.
Another thing is to take the compatibility to older documents into account.
When changing the colors so that they look like the user would expect
due to the standard, then OK. But if this means also that colors in
older documents will now look different, then ... hm ... it needs to be
investigated how bad it really would be.
Marcus
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Kay Schenk <ka...@gmail.com>.
On 10/28/2014 03:25 PM, Regina Henschel wrote:
> Hi Kay,
>
> Kay Schenk schrieb:
>> On Mon, Oct 27, 2014 at 8:27 AM, Regina Henschel
>> <rb...@t-online.de>
>> wrote:
>>
>>> Hi Kay,
>>>
>>> Kay Schenk schrieb:
>>>
>>>>
>>>> Hi Regina --
>>>>
>>>> I saw that you had already made some changes yesterday re i118191
>>>>
>>>> https://issues.apache.org/ooo/show_bug.cgi?id=118191
>>>>
>>>> I have not investigated color renderings in AOO at all in terms of
>>>> values,
>>>> but my first thought is we should be consistent across modules on
>>>> how this
>>>> is done. RGB vs HTML?
>>>>
>>>
>>> I have compared Calc to StarMath to HTML in the attachments. There is
>>> currently no consistence between Calc and Math.
>>>
>>> Kind regards
>>> Regina
>>>
>>
>> Thanks for your research. I started thinking maybe making these
>> consistent
>> across all modules (really I have not looked into this yet), would be a
>> good "easy" fix for a new volunteer. What do you think?
>
> For module Math it is too late to make it an "easy" fix, because the fix
> is finished, beside the question, what color to use. When I started I
> had no idea how easy or hard it would be.
Right, I saw your changes but didn't evaluate the extent.
>
> For Calc I have looked around, but could not find the place yet. So if
> someone can provide a pointer, then it might work. But I'm not sure
> because localization is involved.
>
> Back to the question, which color to use:
> Foreign (not OpenOffice or LibreOffice) .odf documents will use the
> html-color-names and those names are standardized. So for that names I
> think, there is no choice, we have to render them as they are defined in
> the standard. Do you agree?
Of course, we have to use what is defined in the standard.
>
> So the color name "red" will be #ff0000 in Math as it is already in
> Calc, and the color name "blue" will be #0000ff in Math as it is already
> in Calc. That gives a more consistent use and solves issue i118191. But
> old documents will be rendered different.
>
> The color name green in Math has the same rendering as green in html, so
> that can stay. For Calc it can be solved, when the color name "lime" is
> allowed too and mapped to the light green and "green" to the dark green.
> Color names are not stored in the Calc files and therefore old documents
> are not affected.
>
> The question is, what to do with names "cyan" and "magenta"? These names
> do not belong to the standard. So we can decide, which color OpenOffice
> renders and which color it writes to the file. If Math will use them the
> same way as Calc, then "cyan" has to be rendered same as "aqua" and
> "magenta" same as "fuchsia". OpenOffice writes currently "aqua" and
> "fuchsia" to the MathML part of the file already. That would make the
> names consistent between Math and Calc and between rendering via
> StarMath and rendering via pure MathML. But old documents would be
> rendered different. Shall I change the rendering of "cyan" and "magenta"
> to the light colors too?
Personally, I would make them consistent from this day forward, so I
would say "yes" make MathML the same as Calc.
I just found this reference area for color codes/names--
http://www.rapidtables.com/web/color/cyan-color.htm
cyan = aqua in rgb
http://www.rapidtables.com/web/color/purple-color.htm
same for magenta = fuchsia
Others may have a different opinion though.
>
> Kind regards
> Regina
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
--
-------------------------------------------------------------------------
MzK
"One must still have chaos in oneself to be able to give birth
to a dancing star."
-- Friedrich Nietzsche
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi Kay,
Kay Schenk schrieb:
> On Mon, Oct 27, 2014 at 8:27 AM, Regina Henschel <rb...@t-online.de>
> wrote:
>
>> Hi Kay,
>>
>> Kay Schenk schrieb:
>>
>>>
>>> Hi Regina --
>>>
>>> I saw that you had already made some changes yesterday re i118191
>>>
>>> https://issues.apache.org/ooo/show_bug.cgi?id=118191
>>>
>>> I have not investigated color renderings in AOO at all in terms of values,
>>> but my first thought is we should be consistent across modules on how this
>>> is done. RGB vs HTML?
>>>
>>
>> I have compared Calc to StarMath to HTML in the attachments. There is
>> currently no consistence between Calc and Math.
>>
>> Kind regards
>> Regina
>>
>
> Thanks for your research. I started thinking maybe making these consistent
> across all modules (really I have not looked into this yet), would be a
> good "easy" fix for a new volunteer. What do you think?
For module Math it is too late to make it an "easy" fix, because the fix
is finished, beside the question, what color to use. When I started I
had no idea how easy or hard it would be.
For Calc I have looked around, but could not find the place yet. So if
someone can provide a pointer, then it might work. But I'm not sure
because localization is involved.
Back to the question, which color to use:
Foreign (not OpenOffice or LibreOffice) .odf documents will use the
html-color-names and those names are standardized. So for that names I
think, there is no choice, we have to render them as they are defined in
the standard. Do you agree?
So the color name "red" will be #ff0000 in Math as it is already in
Calc, and the color name "blue" will be #0000ff in Math as it is already
in Calc. That gives a more consistent use and solves issue i118191. But
old documents will be rendered different.
The color name green in Math has the same rendering as green in html, so
that can stay. For Calc it can be solved, when the color name "lime" is
allowed too and mapped to the light green and "green" to the dark green.
Color names are not stored in the Calc files and therefore old documents
are not affected.
The question is, what to do with names "cyan" and "magenta"? These names
do not belong to the standard. So we can decide, which color OpenOffice
renders and which color it writes to the file. If Math will use them the
same way as Calc, then "cyan" has to be rendered same as "aqua" and
"magenta" same as "fuchsia". OpenOffice writes currently "aqua" and
"fuchsia" to the MathML part of the file already. That would make the
names consistent between Math and Calc and between rendering via
StarMath and rendering via pure MathML. But old documents would be
rendered different. Shall I change the rendering of "cyan" and "magenta"
to the light colors too?
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org
Re: color names in Math
Posted by Kay Schenk <ka...@gmail.com>.
On Mon, Oct 27, 2014 at 8:27 AM, Regina Henschel <rb...@t-online.de>
wrote:
> Hi Kay,
>
> Kay Schenk schrieb:
>
>>
>> Hi Regina --
>>
>> I saw that you had already made some changes yesterday re i118191
>>
>> https://issues.apache.org/ooo/show_bug.cgi?id=118191
>>
>> I have not investigated color renderings in AOO at all in terms of values,
>> but my first thought is we should be consistent across modules on how this
>> is done. RGB vs HTML?
>>
>
> I have compared Calc to StarMath to HTML in the attachments. There is
> currently no consistence between Calc and Math.
>
> Kind regards
> Regina
>
Thanks for your research. I started thinking maybe making these consistent
across all modules (really I have not looked into this yet), would be a
good "easy" fix for a new volunteer. What do you think?
--
-------------------------------------------------------------------------------------------------
MzK
"One must still have chaos in oneself to be able to give birth
to a dancing star."
-- Friedrich Nietzsche
Re: color names in Math
Posted by Regina Henschel <rb...@t-online.de>.
Hi Kay,
Kay Schenk schrieb:
>
> Hi Regina --
>
> I saw that you had already made some changes yesterday re i118191
>
> https://issues.apache.org/ooo/show_bug.cgi?id=118191
>
> I have not investigated color renderings in AOO at all in terms of values,
> but my first thought is we should be consistent across modules on how this
> is done. RGB vs HTML?
I have compared Calc to StarMath to HTML in the attachments. There is
currently no consistence between Calc and Math.
Kind regards
Regina
Re: color names in Math
Posted by Kay Schenk <ka...@gmail.com>.
On Wed, Oct 22, 2014 at 11:52 AM, Regina Henschel <rb...@t-online.de>
wrote:
> Hi all,
>
> I'm going to work on https://issues.apache.org/ooo/show_bug.cgi?id=118191.
>
> ODF1.2 uses MathML and that allows font colors to be defined by
> html-color-names. The corresponding rgb-values are defined in HTML.
>
> The problems are:
>
> Math writes its "red" as "red" in mml and renders it as rgb 80 00 00. But
> "red" in HTML is defined as FF 00 00. The dark variant is named "maroon".
>
> Math writes its "blue" as "blue" in mml and renders it as rgb 00 00 80.
> But "blue" in HTML is defined as rgb 00 00 FF. The dark variant is named
> "navy".
>
> Math writes its "cyan" as "aqua" in mml and renders it as rgb 00 80 80.
> But "aqua" in HTML is defined as rgb 00 FF FF. The dark variant is named
> "teal". A color name "cyan" does not exist as html-color-name.
>
> Math writes its "magenta" as "fuchsia" in mml and renders it as rbg 80 00
> 80. But "fuchsia" in HTML is defined as rgb FF 00 FF. The dark variant is
> named "purple". A color name "magenta" does not exist as html-color-name.
>
> So in each case the rendering is different from the value in the file. If
> you get a foreign document or a pur MathML formula for import, which have
> no annotation containing the Starmath expression, then it is rendered
> wrongly.
>
> I see two options in general
> (a) change rendering to the rgb-values of the html-color-names contained
> in the file.
> (b) change file export to write html-color-names which meet the rendering.
>
> In addition, as more colors in Math is a very old wish, I want to add the
> missing html-color-name colors in this fix, so that it is possible to use
> 16 colors instead of only 8 colors now. That would not solve
> https://issues.apache.org/ooo/show_bug.cgi?id=5156 totally but would
> help. For #rgb and ##rrggbb colors I would have to learn more about the
> code to solve it.
>
> Suggestions, ideas, concerns?
>
> Kind regards
> Regina
>
Hi Regina --
I saw that you had already made some changes yesterday re i118191
https://issues.apache.org/ooo/show_bug.cgi?id=118191
I have not investigated color renderings in AOO at all in terms of values,
but my first thought is we should be consistent across modules on how this
is done. RGB vs HTML?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
>
--
-------------------------------------------------------------------------------------------------
MzK
"Success breeds complacency. Complacency breeds failure.
Only the paranoid survive."
-- Andy Grove, Intel Co-founder