mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-29 12:17:14 -06:00
Swatches: swatch.library.copyToUser copies a loaded library into User Defined
swatch.library.copyToUser {library} copies a library loaded from
another folder into the user library folder of the desktop app. A
.vcswatches, .gpl or .ase file is copied as it is; the swatches of a
document and a library loaded from the data or dataBase64 parameter are
written as a .vcswatches file. The copy gets a name that no file in the
folder has, and when a file with the same extension and bytes is
already there, that file is used. The library is then listed as User
Defined only. Until the app quits, commands given its loaded id use the
copy, unless another library is loaded under that id. Without a user
library folder (the web and headless sessions) the command is disabled.
A file with the same extension and bytes as a User Defined library
opens as that User Defined library. The unchanged original of a copied
.ase file is one such file. Graphic style libraries open the same way.
This commit is contained in:
@@ -154,7 +154,8 @@ Clicking a swatch there runs `swatch.library.add {library, names: [name], apply}
|
||||
one with Alt), so one undo step adds and applies it; Shift/Cmd-clicks select swatches and colour groups for
|
||||
Add to Swatches.
|
||||
`window.swatchLibrary.other {path?}` loads a library file (or another document's swatches) and opens it there;
|
||||
opening a `.vcswatches`, `.gpl` or `.ase` file with `app.open` does the same. `ui.saveSwatchLibrary {names?}` opens the
|
||||
opening a `.vcswatches`, `.gpl` or `.ase` file with `app.open` does the same. A file with the same extension and
|
||||
bytes as a User Defined library opens as that library. `ui.saveSwatchLibrary {names?}` opens the
|
||||
`saveSwatchLibrary` dialog (fields `name`, `format`: `vcswatches`/`gpl`/`ase`/`css`, `user`: save to the user library
|
||||
folder, `selectedOnly` with `names`); `ui.dialog.confirm` runs `swatch.library.save` (to a file it asks for a path
|
||||
and suggests `name` with the format's extension as the file name; the web downloads the file under that name).
|
||||
|
||||
+9
-2
@@ -804,7 +804,13 @@ it returns `{data}`, or `{dataBase64}` for `.ase`, and `user: true` saves into t
|
||||
folder of the desktop app (listed as category `user`, User Defined). `swatch.library.load {path? | data? |
|
||||
dataBase64?, name?}` loads a `.vcswatches`, `.gpl` or swatch exchange (`.ase`) file, or another document's swatches,
|
||||
as a library to add from. From an `.ase` file it reads RGB, CMYK, Lab and Gray colors as global, spot or process
|
||||
swatches and keeps their color groups.
|
||||
swatches and keeps their color groups. A file in the user library folder, or a file with the
|
||||
same extension and bytes as one there, loads as that User Defined library (category `user`).
|
||||
`swatch.library.copyToUser {library}` copies a loaded library into the user library folder of the desktop
|
||||
app (a library file as it is; a document's swatches or a library loaded from `data` or `dataBase64`
|
||||
as `.vcswatches`) under a name no file there has, and lists it as User Defined from then on; until the app
|
||||
quits, commands given its loaded id use the copy → `{library, name, count, path, copied}` (`copied: false`
|
||||
when the folder already held the same file). Without a user library folder the command is disabled.
|
||||
|
||||
## Graphic style libraries
|
||||
|
||||
@@ -827,7 +833,8 @@ its bounds.
|
||||
the styles unlinked from swatches, with their opacity, blend mode, isolate and knockout, and the patterns they paint
|
||||
with); without `path` it returns `{data}`, and `user: true` saves into the user library folder of the desktop app
|
||||
(category `user`, User Defined). `graphicStyle.loadLibrary {path? | data? | dataBase64?, name?}` loads a `.vcstyles`
|
||||
file, or another document's graphic styles, as a library to add from.
|
||||
file, or another document's graphic styles, as a library to add from; a file in the user library folder, or a file
|
||||
with the same extension and bytes as one there, loads as that User Defined library.
|
||||
|
||||
## Libraries
|
||||
|
||||
|
||||
Reference in New Issue
Block a user