Multiple colors on gradient

LO writter allows only 2 colors for gradient on a shape. In Microsoft word you have the option to add more than 2 colors to a gradient and change their positions.
gradient

See LibreOffice 7.6 Community: Release Notes - The Document Foundation Wiki

Note that there is not yet a user interface to create the multi-colour gradients. You might be able to see multi-colour gradients produced in Word in LO 7.6

1 Like

When I had previously created an image with multiple gradients in MS-Office, I had fortunately saved all of the colors and positions. This allowed me to create a gradient image using LO Draw (with help from Gimp) that allowed me to simulate a similar multi-color gradient.

  1. I created a landscape page in LO Draw and created a box that was 10" by 3" so I had space to work.
  2. My spreadsheet had saved the color of each gradient portion and the percentage of the horizontal (in my case) multi-color gradient I wished to create.
Position Percentage R G B
1 0 82 137 132
2 18 65 108 124
3 39 52 87 107
4 54 114 117 132
5 65 93 111 149
6 75 141 163 187
7 89 200 203 212
8 100 236 237 242
  1. Then I created Boxes that represented each of the offset percentages as the ones in which I would place two-tone gradients.
  2. E.G. Box 1 is 1.8" wide. I used a 90degree linear gradient going from color:
  3. |82|137|132|
    to color:
  4. |65|108|124|
  5. The next box is 2.1" wide (39-18) with a linear gradient going from color:
  6. |65|108|124|
    to color:
  7. |52|87|107|
  8. and so on down the line. so it looks like this:
  9. Then I change the lines to none, and grouped all of the boxes together resulting in:
  10. I copied this image to Gimp, Created an image from the clipboard, then exported the image to a “.png” file
  11. I went back to LO Write and clicked on my Fontwork outline text, then changed the “Area” behind the Fontwork texts, add the image that I had saved in a file and use that as the Area background
  12. The result is not quite as good as in MS-Office, but is a close approximation
  13. There is an alignment issue here. I hope someone else can help to figure out how to fix the alignment, but this is a start toward a solution.
  14. I fixed the alignment issue within gimp. The copied image on the clipboard was 4 inches wide. In Gimp, I scaled the image to 8 inches wide and saved a new image. When I used the new image as the background I got a better result.

    Multiple_Color_Gradient_for_Sea2cloud.odg (32.7 KB)
  15. I uploaded the ODG file that I used to create the multiple color gradient. I actually created the Fontwork file in LO Writer rather than LO Draw. I discovered that LO Draw does not include the tool bar for Drawing Object Properties which seemed like an odd non-orthogonality for Draw not to support that toolbar
3 Likes

Thank you for going to so much trouble for a workaround, but I didn’t quite understand what you wrote under

  1. There is an alignment issue here. I hope someone else can help to figure out how to fix the alignment, but this is a start toward a solution.

Perhaps you can add to it. Thank you.

About

  1. I copied this image to Gimp, Created an image from the clipboard, then exported the image to a “.png” file

You can also convert to a PNG file from Draw.
Select File > Export and then choose PNG and select “Selection” and OK.


It would be helpful if you could upload your ODG file here. Thank you very much.

You get a continuous gradient if you start in the next area with the color you ended with before.



94944 HB Multible Gradient.odg (13,6 KB)


@sailnfool ,
I only had to make a small change at the beginning to get a good multiple gradient.

94944 HB Multiple_Color_Gradient_for_Sea2cloud.odg (32,4 KB)

3 Likes

Sorry if I did not make that clear in my notes above

1 Like

Yes, they must have the same size, but the “error” animates to create variants.

You can edit the file source, see Using multicolor gradients in file markup :: LibreOffice Conference 2023 :: pretalx
or you can use macros Using multicolor gradients in Basic macros :: LibreOffice Conference 2023 :: pretalx
The latter talk page contains a library with some ready to use macros. But the macros do not have nice dialogs but only simple one line input.

Using the colors given in the post from @ sailnfool, you get the attached result.
GradientForAsk.odg (19.4 KB)

To use such gradient in other documents, you can drag the shape into the gallery and later insert it temporarily in a new document. You can there create a style from the shape or copy the gradient with the format brush to the target shape. Or you open the area dialog of the shape and add the gradient to the list of gradients.

1 Like