issue220:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| issue220:inkscape [2025/08/24 17:09] – créée philou511 | issue220:inkscape [2025/09/03 07:58] (Version actuelle) – d52fr | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | Drawing with Inkscape – Part 160 | + | **The topic for this month is a feature that I never really use in Inkscape: color swatches. In theory, they could be a very useful tool for tackling some specific issues or requirements – but, in practice, I find Inkscape’s implementation to be a little too confusing, leading me to avoid them. But since the UI of the Swatches dialog has been overhauled in version 1.4, let’s revisit what they are, how you can use them, why you might want to – and why you might not. |
| - | By Mark Crutch | + | |
| - | + | ||
| - | The topic for this month is a feature that I never really use in Inkscape: color swatches. In theory, they could be a very useful tool for tackling some specific issues or requirements – but, in practice, I find Inkscape’s implementation to be a little too confusing, leading me to avoid them. But since the UI of the Swatches dialog has been overhauled in version 1.4, let’s revisit what they are, how you can use them, why you might want to – and why you might not. | + | |
| Sometimes the term ‘color swatch’ is used to generally refer to an entry in the color palette at the bottom of the Inkscape window, or for similar colored blocks elsewhere in the UI. But in this context we’re talking about something far more specific: an individual color block that appears in the Swatches dialog (View > Swatches, or Ctrl-Shift-W). Opening this dialog could, initially, lead to disappointment, | Sometimes the term ‘color swatch’ is used to generally refer to an entry in the color palette at the bottom of the Inkscape window, or for similar colored blocks elsewhere in the UI. But in this context we’re talking about something far more specific: an individual color block that appears in the Swatches dialog (View > Swatches, or Ctrl-Shift-W). Opening this dialog could, initially, lead to disappointment, | ||
| + | If you see this view, it just means that there are no swatches defined in your document as yet. We’ll come on to how you create them shortly, but first it’s useful to understand the three main reasons why you might want to use swatches in the first place. | ||
| + | To use a very specific (named) color | ||
| + | To use a predefined collection of specific colors | ||
| + | To easily change the color of multiple objects simultaneously** | ||
| + | Le sujet du mois est une fonctionnalité que je n' | ||
| + | Le terme « palettes » désigne parfois une entrée de la palette de couleurs en bas de la fenêtre d' | ||
| + | Si vous voyez cette vue, cela signifie simplement qu' | ||
| + | ••Utiliser une couleur très spécifique (nommée) | ||
| + | ••Utiliser une collection prédéfinie de couleurs spécifiques | ||
| + | ••Modifier facilement la couleur de plusieurs objets simultanément | ||
| + | **In the old days of lithographic printing, that first reason was far more important than it is now. Most color printing is now done using CMYK colors – combining Cyan, Magenta, Yellow and blacK in different proportions to produce a wide range of colors. Other, similar systems may use more base colors, but they still combine them in different proportions to produce any given color on the page. | ||
| + | On a modern digital press, which uses toners in a similar manner to a laser printer or photocopier, | ||
| + | You may have heard of spot colors through the term ‘Pantone colors’. This is a reference to the largest vendor of these color recipes, used throughout the printing industry. When a company’s logo is defined as “Pantone Reflex Blue” or “Pantone PMS 803 C”, they can be sure that it will be reproduced in precisely the correct color – assuming they’re using lithographic printing, and a competent print supplier. | ||
| + | The first use of swatches is therefore to define a very specific color. Except that the Pantone system is proprietary (and expensive) – and Inkscape, due to the web-based history of the SVG format, doesn’t really support anything other than RGB colors anyway. Try defining the color of an Inkscape swatch as “Pantone Reflex Blue” and you’ll get nowhere.** | ||
| + | À l' | ||
| + | Sur une presse numérique moderne, qui utilise des toners comme une imprimante laser ou un photocopieur, | ||
| - | If you see this view, it just means that there are no swatches defined in your document as yet. We’ll come on to how you create them shortly, but first it’s useful to understand the three main reasons why you might want to use swatches in the first place. | + | Vous avez peut-être entendu parler des tons directs sous le terme « couleurs Pantone ». Il s'agit du plus grand fournisseur de ces formules de couleurs, utilisées dans l' |
| - | To use a very specific (named) color | + | |
| - | To use a predefined collection of specific colors | + | |
| - | To easily change the color of multiple objects simultaneously | + | |
| - | In the old days of lithographic printing, that first reason was far more important than it is now. Most color printing is now done using CMYK colors – combining Cyan, Magenta, Yellow and blacK in different proportions to produce a wide range of colors. Other, similar systems may use more base colors, but they still combine them in different proportions to produce any given color on the page. | + | L' |
| - | On a modern digital press, which uses toners in a similar manner to a laser printer or photocopier, | + | |
| - | You may have heard of spot colors through the term ‘Pantone | + | |
| - | The first use of swatches is therefore to define a very specific color. Except that the Pantone system is proprietary | + | |
| - | While this does greatly limit the utility of Inkscape swatches for this purpose, it doesn’t render them completely useless. Okay, so you’re not going to be defining spot colors with Pantone references in your Inkscape documents, but most companies now have RGB equivalents (or approximations) of their corporate colors for use on websites and other purely digital media. You may not be able to use “Pantone Reflex Blue”, but your corporate style guide might let you swap it out for an RGB value of #011589 when used in a digital context. In this sense, swatches in Inkscape provide a way to define specific named colors. Let’s give that a try… | + | |
| - | In order to create a swatch in your document, you might expect to open the Swatches dialog and find a button to create and name a new entry. But that’s not how it works, unfortunately. Instead, swatches are created via the Fill & Stroke dialog, and the options you need are available only when an object is selected on the canvas. Our first step, therefore, is to create an object of some sort – just a plain ellipse or rectangle will do – and open the Fill & Stroke dialog. | + | |
| - | You can define a swatch on the fill or the stroke tab (or both). I usually set the fill color, as it’s a lot more obvious than a potentially thin stroke. Either way, in the collection of buttons at the top – where you might usually select a flat color or gradient – click on the penultimate button, which should have a tooltip of “Swatch”. This will display a list of the existing document swatches (possibly only one, if this is the first one you’re creating), with the usual selection of color pickers below. You can use any of these to define your color, whether by moving sliders, entering values directly, or showing the color wheel. In this example image, I pasted the RGB hex code from a couple of paragraphs above into the RGBA field at the bottom right – Inkscape automatically removed the hash (#) and added an extra ‘ff’ at the end for the Alpha (opacity) value. | + | |
| + | **While this does greatly limit the utility of Inkscape swatches for this purpose, it doesn’t render them completely useless. Okay, so you’re not going to be defining spot colors with Pantone references in your Inkscape documents, but most companies now have RGB equivalents (or approximations) of their corporate colors for use on websites and other purely digital media. You may not be able to use “Pantone Reflex Blue”, but your corporate style guide might let you swap it out for an RGB value of #011589 when used in a digital context. In this sense, swatches in Inkscape provide a way to define specific named colors. Let’s give that a try… | ||
| + | In order to create a swatch in your document, you might expect to open the Swatches dialog and find a button to create and name a new entry. But that’s not how it works, unfortunately. Instead, swatches are created via the Fill & Stroke dialog, and the options you need are available only when an object is selected on the canvas. Our first step, therefore, is to create an object of some sort – just a plain ellipse or rectangle will do – and open the Fill & Stroke dialog.** | ||
| + | Bien que cela limite considérablement l' | ||
| + | Pour créer une palette dans votre document, vous pourriez vous attendre à ouvrir la boîte de dialogue Palettes et à trouver un bouton permettant de créer et de nommer une nouvelle entrée. Malheureusement, | ||
| + | **You can define a swatch on the fill or the stroke tab (or both). I usually set the fill color, as it’s a lot more obvious than a potentially thin stroke. Either way, in the collection of buttons at the top – where you might usually select a flat color or gradient – click on the penultimate button, which should have a tooltip of “Swatch”. This will display a list of the existing document swatches (possibly only one, if this is the first one you’re creating), with the usual selection of color pickers below. You can use any of these to define your color, whether by moving sliders, entering values directly, or showing the color wheel. In this example image, I pasted the RGB hex code from a couple of paragraphs above into the RGBA field at the bottom right – Inkscape automatically removed the hash (#) and added an extra ‘ff’ at the end for the Alpha (opacity) value. | ||
| + | In the list at the top, your swatch will have been given a default name, such as “swatch1” – you can click on the name to change it, which I definitely recommend if you want to use swatch colors for very specific purposes. Here, I’ve changed mine to be called “Not Reflex Blue”. | ||
| + | Now, back to the Swatches dialog, and you should see your new swatch in all its glory (assuming you’ve got the “Document swatches” option selected in the dropdown). You may see your swatch as a square, or stretched out into a rectangle, depending on the configuration you’ve got defined in the settings menu (the cog icon at the bottom-right of the dialog). Hovering over the swatch will show the name you defined in a tooltip. Alternatively, | ||
| + | Vous pouvez définir un échantillon dans l' | ||
| + | Dans la liste en haut, votre échantillon aura un nom par défaut, par exemple « échantillon1 ». Cliquez dessus pour le modifier, ce que je recommande vivement si vous souhaitez utiliser des couleurs d' | ||
| + | Retournez maintenant à la boîte de dialogue « Échantillons » et vous devriez voir votre nouvel échantillon dans toute sa splendeur (si l' | ||
| - | In the list at the top, your swatch will have been given a default | + | **Oddly, you can’t actually edit the name here. What you can do is to right-click on the swatch itself (though not on the name), to open a context menu. The “Edit…” option in the menu will open the Fill & Stroke |
| - | Now, back to the Swatches dialog, and you should see your new swatch in all its glory (assuming you’ve got the “Document swatches” option | + | |
| + | The other options in that menu are fairly self-explanatory. Setting the fill or stroke color is more easily done by clicking on the swatch (fill) or shift-clicking (stroke) – do the same on the red X swatch to remove the fill and/or stroke. The Pin Color option will, as its name suggests, pin the swatch to the top of the dialog, next to the X – which may be useful if you have a lot of swatches, but only a few that you frequently use. Note that pinning a color removes it from its position in the list rather than creating a ‘clone’ of the original, so if you’ve defined a specific series of colors (such as a stepped gradient) this might somewhat spoil your order. Unpinning will put it back into place though. Swatches appear in the dialog in reverse order of creation, with no way to sort them by name or color, which is another big omission in my opinion.** | ||
| + | Curieusement, | ||
| + | Les autres options de ce menu sont assez explicites. Pour définir la couleur de fond ou de contour, cliquez sur l' | ||
| + | **Now you know how to create your own document swatches, it’s time to move onto my second reason for using swatches: to use a predefined collection of specific colors. At the top-left of the Swatches dialog is a pop-up which opens a menu listing all the palettes Inkscape knows about. These are the same ones you’ll see if you click the menu button at the end of the main palette below the canvas. Although it’s the same list, there’s no synchronisation here; the two selections are independent of each other. Selecting a palette for the main window won’t change the selection in the Swatches dialog, nor vice versa. | ||
| + | Using the pop-up in the dialog to select a palette here will, as you might expect, show swatches for each of the colors in the palette as separate swatches. Depending on the palette you choose, the entries may have names, just hex values, or even a mixture of both. The lack of any sorting in the dialog means you’re at the mercy of the order in which the colors are specified in the underlying palette file. This can lead to quite jumbled swatches – as with the SVG palette in this image. | ||
| + | Note in that screenshot that there are no pinned swatches next to the red X, despite me having pinned my “Not Reflex Blue” swatch previously. Pinned swatches remain specific to the selected palette, so the one I pinned when viewing “Document Swatches” doesn’t appear here, and a color pinned here won’t appear when any other palette is selected. For some situations this could be useful, to prevent you accidentally using an out-of-palette swatch that you pinned in another context. But it also prevents you from creating a ‘greatest hits’ collection of your favourite swatches across different sources. As you might have guessed, pinning colors here also does not affect the pinned colors in the main palette below the canvas, nor the other way round.** | ||
| + | Maintenant que vous savez créer vos propres palettes, il est temps de passer à la deuxième raison de leur utilisation : | ||
| + | L' | ||
| - | Oddly, you can’t actually edit the name here. What you can do is to right-click on the swatch itself (though not on the name), to open a context menu. The “Edit…” option in the menu will open the Fill & Stroke dialog with the swatch already selected and ready to alter – allowing you to change the color, or the name. | + | Remarque : sur cette capture d' |
| + | **Still, not having a way to pin a swatch across palettes is no great hardship, because as soon as you use a swatch from another palette, it will become available in the “Document Swatches” view, right? Alas, no. When you select a swatch from a predefined palette to apply it to the fill or stroke of an object, all it actually does is set the RGB color on that object – it doesn’t actually create or use a document swatch. This means that the “Swatches” dialog actually serves two different purposes: it shows Inkscape swatches (i.e. Document Swatches), and it displays palettes that just set RGB values, much like the palette at the bottom of the main window. But these are two separate notions of the word ‘swatch’, | ||
| + | There is an awkward workaround. If you apply a fill or stroke color using a palette – either from the Swatches dialog or from the bottom of the main window – it will appear as a solid fill (or stroke) in the Fill & Stroke dialog. Simply switching to the Swatches section within this dialog will create a new document swatch with the selected color – in other words, it’s a mechanism to copy the RGB value of the palette color to a document swatch. You’ll have to set the swatch name manually, however, as that information does not get carried over.** | ||
| + | Cependant, ne pas pouvoir épingler un échantillon sur plusieurs palettes n'est pas un problème majeur, car dès que vous utilisez un échantillon d'une autre palette, il devient disponible dans la vue « Échantillons du document », | ||
| + | Il existe une solution de contournement délicate. Si vous appliquez une couleur de fond ou de contour à l'aide d'une palette, que ce soit depuis la boîte de dialogue Palette ou depuis le bas de la fenêtre principale, elle apparaîtra comme un fond uni (ou un contour) dans la boîte de dialogue Fond et contour. Il suffit d' | ||
| + | **The Swatches dialog does offer one advantage over just using the palette on the main screen: at the bottom-left of the dialog is a button which allows you to dynamically load a palette from disk. The supported formats are ‘Gimp Color Palette’, ‘Adobe Color Book’ and ‘Adobe Swatch Exchange’ – so this feature might prove invaluable if you work in the sort of environment with a corporate color scheme available to download in one of these formats. | ||
| - | The other options in that menu are fairly self-explanatory. Setting the fill or stroke color is more easily done by clicking on the swatch (fill) or shift-clicking (stroke) – do the same on the red X swatch to remove the fill and/or stroke. The Pin Color option will, as its name suggests, pin the swatch | + | This ability to load palettes |
| - | Now you know how to create your own document swatches, it’s time to move onto my second reason for using swatches: to use a predefined collection of specific colors. At the top-left of the Swatches | + | |
| - | Using the pop-up in the dialog to select | + | |
| + | La boîte de dialogue Palettes offre un avantage par rapport à la simple utilisation de la palette sur l' | ||
| - | Note in that screenshot that there are no pinned swatches next to the red X, despite me having pinned my “Not Reflex Blue” swatch previously. Pinned swatches remain specific to the selected palette, so the one I pinned when viewing “Document Swatches” doesn’t appear here, and a color pinned here won’t appear when any other palette is selected. For some situations this could be useful, to prevent you accidentally using an out-of-palette swatch that you pinned in another context. But it also prevents you from creating a ‘greatest hits’ | + | Cependant, cette possibilité de charger des palettes ne permet pas de créer les vôtres. Il serait intéressant de pouvoir créer une collection |
| - | Still, not having a way to pin a swatch across | + | |
| - | There is an awkward workaround. If you apply a fill or stroke color using a palette – either from the Swatches dialog or from the bottom of the main window – it will appear as a solid fill (or stroke) in the Fill & Stroke dialog. Simply switching to the Swatches section within this dialog will create a new document swatch with the selected color – in other words, it’s a mechanism to copy the RGB value of the palette color to a document swatch. You’ll have to set the swatch name manually, however, as that information does not get carried over. | + | |
| - | The Swatches dialog does offer one advantage over just using the palette on the main screen: at the bottom-left of the dialog is a button which allows you to dynamically load a palette from disk. The supported formats are ‘Gimp Color Palette’, ‘Adobe Color Book’ and ‘Adobe Swatch Exchange’ – so this feature might prove invaluable if you work in the sort of environment with a corporate color scheme available to download in one of these formats. | + | **Even worse than this, exporting a palette in this way fails to put an entry into the ‘Name:’ field of the file – without which the Swatches dialog refuses to load it. So even if you’re happy to lose or re-create your swatch names, you’ll still have to edit the exported file if you want to be able to load it again later. Thankfully the format of a GIMP palette file is pretty straightforward, |
| - | This ability to load palettes is not, however, matched with a means to create your own. It would be great if you could create a collection of Document Swatches and save it out into a supported | + | |
| - | Even worse than this, exporting a palette in this way fails to put an entry into the ‘Name:’ field of the file – without which the Swatches dialog refuses to load it. So even if you’re happy to lose or re-create your swatch names, you’ll still have to edit the exported file if you want to be able to load it again later. Thankfully the format of a GIMP palette file is pretty straightforward, | + | |
| The third way I suggested swatches might be useful is “to be able to change the color of multiple objects simultaneously”. What I mean by this is that document swatches effectively act as variables in an Inkscape document. If you change the color of a document swatch, then all objects using it will immediately update to the same color. | The third way I suggested swatches might be useful is “to be able to change the color of multiple objects simultaneously”. What I mean by this is that document swatches effectively act as variables in an Inkscape document. If you change the color of a document swatch, then all objects using it will immediately update to the same color. | ||
| - | Consider, for example, creating a mock-up of a user interface which has a specific accent color. By using a document swatch, you can quickly change the accent color for every element in the mock-up in order to produce differently themed examples of the UI. Or think of a “Congratulations” banner where the winning team is not yet known. You can create the entire design using a document swatch, and just update it to the right color once the results are in. There are lots of ways in which it can be useful to ensure that multiple objects all use the same color, and all update to a change in that color at once. | + | |
| - | But that brings me onto the disadvantages of swatches. Quite frankly they serve too many purposes, but do none of them particularly well. If you create your own document swatches, it can be really useful to be able to trivially change them and have every object update. But that can also be dangerous when you need to set a very specific color, and want to avoid the possibility of an accidental update. Yet there’s no way to lock a document swatch against further editing to help avoid this problem. | + | Consider, for example, creating a mock-up of a user interface which has a specific accent color. By using a document swatch, you can quickly change the accent color for every element in the mock-up in order to produce differently themed examples of the UI. Or think of a “Congratulations” banner where the winning team is not yet known. You can create the entire design using a document swatch, and just update it to the right color once the results are in. There are lots of ways in which it can be useful to ensure that multiple objects all use the same color, and all update to a change in that color at once.** |
| + | |||
| + | Pire encore, exporter une palette de cette manière ne permet pas d' | ||
| + | La troisième utilité des palettes que j'ai suggérée est de « permettre de modifier la couleur de plusieurs objets simultanément ». Ce que je veux dire par là, c'est que les palettes de document agissent comme des variables dans un document Inkscape. Si vous modifiez la couleur d'une palette de document, tous les objets qui l' | ||
| + | |||
| + | Envisagez, par exemple, la création d'une maquette d' | ||
| + | |||
| + | |||
| + | **But that brings me onto the disadvantages of swatches. Quite frankly they serve too many purposes, but do none of them particularly well. If you create your own document swatches, it can be really useful to be able to trivially change them and have every object update. But that can also be dangerous when you need to set a very specific color, and want to avoid the possibility of an accidental update. Yet there’s no way to lock a document swatch against further editing to help avoid this problem. | ||
| One solution might be to create your own palette of fixed colors but, as we’ve seen, Inkscape doesn’t make that an easy task to achieve. And with no way to pin swatches across multiple palettes, you might end up having to ‘copy’ your colors back to Document Swatches, which brings back the same potential editing issues. | One solution might be to create your own palette of fixed colors but, as we’ve seen, Inkscape doesn’t make that an easy task to achieve. And with no way to pin swatches across multiple palettes, you might end up having to ‘copy’ your colors back to Document Swatches, which brings back the same potential editing issues. | ||
| + | |||
| Then there’s the limited way in which Document Swatches can be used. They can be set on the fill or stroke of an object, but that’s all. You can’t use them to create named stops in a gradient, or when picking the color of a pattern, grid or guideline. Realistically these may not be practical limitations, | Then there’s the limited way in which Document Swatches can be used. They can be set on the fill or stroke of an object, but that’s all. You can’t use them to create named stops in a gradient, or when picking the color of a pattern, grid or guideline. Realistically these may not be practical limitations, | ||
| - | When looked at in that light, it’s not surprising that I don’t use them much. | + | When looked at in that light, it’s not surprising that I don’t use them much.** |
| + | |||
| + | Mais cela m' | ||
| + | |||
| + | Une solution pourrait être de créer votre propre palette de couleurs fixes, mais, comme nous l' | ||
| + | |||
| + | Ensuite, les Palettes sont limitées dans leur utilisation : | ||
| - | Mark uses Inkscape to create comics for the web (http://www.peppertop.com/ | + | Dans ce contexte, il n'est pas surprenant que je les utilise peu. |
issue220/inkscape.1756048189.txt.gz · Dernière modification : 2025/08/24 17:09 de philou511
