27 Commits
Author SHA1 Message Date
Xisco Fauli 0159850b67 [API CHANGE] drop ComplexColorJSON
No need to use it when we can use ComplexColor

Change-Id: I921e229d2dee719b7457f046c1ed1ff0492aa3e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205810
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 20:07:19 +02:00
Xisco Fauli fb28678005 loplugin:unusedmethods
Change-Id: If3dae53e3cf16df2d0c505a898138dfa6fe6c0f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205442
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 09:32:38 +02:00
Noel Grandin 71b81c3131 Add some comments to ComplexColor
Change-Id: Ie08e352e0cca7b6534c1b5cc1d34db5d677537e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199807
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-02-20 13:35:13 +01:00
Tomaž Vajngerl 6b3ba34d3a sd: Default drawing style to use ComplexColor for fill and line
This changes the default drawing style to use theme colors for
fill and line colors that will be used by by shapes. The use of
theme color is needed so that changing the document theme will
have an effect by default. This also means the default color
will be different than before - it will use the colors defined
by the default theme used by documents (LibreOffice theme).

Additionally it increases the default line size to make the
shapes more atttractive.

Test testThemeShapeInsert has been re-added and changed to pass.
Other tests have been fixed or changed to set to use the default
theme by force, which uses the old fill color for accent{1,2,3}
and old line color for accent{4,5,6}. With this the tests don't
need to be changed if they check the FillColor, which is set to
a default color (from the style).

Change-Id: Ibb16961dec79232603619efe040db70d90e07cee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195787
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2026-01-06 15:45:27 +01:00
Tomaž Vajngerl dba71e531d fix ComplexColor comment that was cut off mid sentence
Change-Id: I7d04f2b916f0b4cdb3694908e6895dd9fdc2ae22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196241
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-12-27 08:45:49 +01:00
Tomaž Vajngerl 1dbe0aa24f docmodel: add ComplexColor.cxx and move function definitions there
No need to be a template only class.

Change-Id: I3d73fe18443662205967ce5904233a93d7785164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195166
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-12-08 04:15:06 +01:00
Kurt Nordback a07bad0cc8 oox: next step to replace oox::drawingml::Color with ComplexColor
ComplexColor is a replacement for oox::drawingml::Color, so both
share a lot in common, but oox::drawingml::Color is only used to
resolve the colors inside oox. The idea is to replace step by step
oox::drawingml::Color with ComplexColor. In this step a lot of
ComplexColor types are used instead in oox::drawingml::Color types.

Additionally oox::drawingml::Color is not mandatory anymore for
a lot of contexts, so depending on the need ComplexColor can be
used or oox::drawingml::Color.

Change-Id: I6613a0f63cc9b7d070841d4f667363b03e6cbaa8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194645
Code-Style: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-11-27 01:33:12 +01:00
Kurt Nordback 6195f52e3f tdf#167941 Extend Transformation value from sal_Int16 to sal_Int32
Needed to make it compatible with oox::drawingml::Color.

Change-Id: I129c03c0510822682afc1eca35c5b912c5d94b3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194203
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-11-20 05:48:03 +01:00
Noel Grandin 04c73e2749 cool#8327 use tools::JsonWriter for theme colors
Change-Id: Iebca3781910f9e28100258da8266d51f673f31d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164232
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-04 11:50:45 +01:00
Julien Nabet 4aa5e93a80 c++20: use std::erase(_if) instead of std::remove(_if)+erase (include part)
Change-Id: I32ac73e1ada08bfaa29e654f26fc89257733cd79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159614
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18 18:39:14 +01:00
Gabor Kelemen 35af9aa550 tdf#146619 Recheck include/d* with IWYU
Change-Id: Ib17953b49e5035255203e33778a262211d1491f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156985
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-23 07:22:53 +02:00
Tomaž Vajngerl 03bc5199f9 various theme and complex color related fixes
Most of changes are a results of code reviews.

Added comments and clarifications, removed unneeded methods,
renamed variables to be more clear, protection against nullptr
dereference,...

Change-Id: Iae2b6abfa90b3bbd3f28328ca7fcf429765cbe9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156203
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-09-01 22:52:16 +02:00
Tomaž Vajngerl 9d5a7d9257 ComplexColor various clean-up and (trivial) refactorings
Don't allow access to member variables of ComplexColor and makes
them private. Needs a lot of changes.

Change "scheme" to "theme" to be more consistent. In LO we usually
call the "theme color" what is usually refered to as "scheme color"
in OOXML, where it is sometimes refered to as "scheme" and other times
as theme color.

Remove ThemeColor class which was replaced with CmplexColor some
time ago.

Remove un-needed includes and un-needed components.

Use isValidThemeColor in many places where we check that the
ComplexColor is of "Theme" type and that ThemeColorType is set to
a valid value.

Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-15 20:58:13 +02:00
Mike Kaganski c66040da56 Rename setRGB to createRGB to make it less misleading
Somehow I overlooked completely, that there already is a non-static
setRGB. Thanks Miklos and Tomaž for the heads up!

Change-Id: If20018a317d90e0a6297950dff201671316aacad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155353
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-05 06:02:49 +02:00
Michael Weghorn b1c339686c docmodel: Fix comment at end of namespace
Change-Id: I6a89ae49f735bde8220a110d83001604cc3c335e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155337
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-04 16:11:32 +02:00
Mike Kaganski c08dc58e47 Rename ComplexColor::RGB to setRGB, to avoid conflict with Windows define
Affects Windows' no-pch builds.

Change-Id: Ifff401df40854f59760bd398c156a8837b528efe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155340
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-04 12:49:44 +02:00
Tomaž Vajngerl c8d8bf4282 sc: theme color support for sparklines + ODF & OOXML import/export
This changes Sparkline colors to use complex colors instead and
adds Sparkline theme color import and export support for ODF and
OOXML.

Change-Id: I58edd525d50f95199bd4fe7825afb51aaa7fc091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155113
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-02 21:22:43 +02:00
Tomaž Vajngerl 20dbfa10d8 sc: OOXML export of theme colors for text and background
Change-Id: Ifd0d8184c9210caa5ca099767baa5dbbf8783f36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153785
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-07-04 08:40:20 +02:00
Tomaž Vajngerl 7501f89282 sc: use ComplexColor for font color (+others) in OOXML export
Change-Id: I2544c7ece152323d84faafe1a544e4f89ca466d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152014
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-29 04:57:36 +02:00
Tomaž Vajngerl 17105fc44b sw: remove char color GrabBag and fix export, fix tint/shade calc.
Don't store values from grab bag when exporting character theme
colors and tint/shade values. The values could be wrong now and
aren't needed anyway as we support the values in the model.
Add proper export support for char color theme information with
correct conversion of values into tint/shade values in 0-255
inverted interval.
This also fixes the import of tint/shade values whcih calculation
was slightly off. We divided by 256 instead of 255, which
introduced an error.

In addition introduce ThemeColorUsage enum, which marks if the
theme color type has a specific "usage" - text or background. This
is determined on import if the theme type is background{1,2} or
text{1,2}. This is then taken into account on export, so the
exact type is preserved.

Change-Id: I0022a159397fd0c3d39a118a7149bb2488dfc149
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152705
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-08 07:45:13 +02:00
Tomaž Vajngerl e86a0236e6 lok: callback to send the updated theme palette when theme changes
The callback sends the updated theme color palette when the theme
changes or initially when the view is registered, so the client
should always have the up-to-date theme color palette stored, so
it can just show the color picker with the theme at any time without
the need to call the server.

Change-Id: I7cceccc46c2fad23ba89e6d3f3643e37f8dab292
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152589
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-05 13:06:57 +02:00
Tomaž Vajngerl 38e0e78998 xmloff: add color-type attribute to complex color
We need to identify what the color type of the complex color is.
For now we mostly use "theme", but in the future we can also have
other types like "rgb",... when the infrastructure for that is
built.

Change-Id: I38c91d294a191ca3124be4e99050977c9815d23e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152253
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-27 06:00:31 +02:00
Tomaž Vajngerl a3d566165c docmodel: add hash to ComplexColor and Transformation classes
Change-Id: I206235162b057f184fbd413982c06f9bd9fa8a94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152013
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-20 11:54:28 +02:00
Tomaž Vajngerl 1df0565fb9 use ComplexColor instead of ThemeColor for better OOXML compat.
In OOXML a color definition includes more represenations, one of
which is scheme color (which is what is implemented in ThemeColor
currently), but it supports other representations too (RGB, HSL,
System,..). ComplexColor includes all the representations, so to
have a better compatibility with OOXML, this changes all uses of
ThemeColor to ComplexColor.
In many cases the usage of ComplexColor isn't the same as the
usage of ThemeColors, but this cases will need to be changed in a
later commit.

Change-Id: I9cc8acee2ac0a1998fe9b98247bcf4a96273149a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151492
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-12 05:00:28 +02:00
Tomaž Vajngerl 900c3a2a85 svx: use ComplexColor in SvxColorItem instead of the ThemeColor
ComplexColor includes everything a ThemeColor has and in addition
also can have various other representations that are supported by
OOXML. This is important for compatibility reasons to preserve the
color information.

Change-Id: I677775a96511dc1742c75b1949e002eaa8c622e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151226
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-08 07:23:17 +02:00
Tomaž Vajngerl 113c6d11af docmodel: extract ColorDefinition into own file and rename
ColorDefinition is renamed into ComplexColor.

Change-Id: I81c2d97e6b7bf9de4ce703c02b6db40636b04961
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151224
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-01 06:05:19 +02:00
Tomaž Vajngerl a0a61ffc29 docmodel: extract Transformation from ThemeColor into own file
Change-Id: I45316e377cf895773037f500c521111f7e4d1ed7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151223
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-01 06:05:13 +02:00