A README.md => README.md +5 -0
@@ 0,0 1,5 @@
+# vier
+
+_Vier_ is a keyboard-focused pixel art editor heavily inspired by Vim.
+
+## [Documenatation](https://xigoi.srht.site/vier)
A scripts/upload.fish => scripts/upload.fish +4 -0
@@ 0,0 1,4 @@
+#!/usr/bin/env fish
+tar -cvz -C website . -f site.tar.gz
+hut pages publish -d xigoi.srht.site -s vier site.tar.gz
+rm site.tar.gz
M website/index.html => website/index.html +5 -2
@@ 24,12 24,13 @@ nimble <span class="token function">install</span>
</code></pre></section>
<section><h2 class="xd-section-heading">Modes and Tools</h2>In most graphics editing programs, there is the concept of a <dfn>tool</dfn>, a state of the editor which determines what action is performed when clicking on an image. This is also the case for Vier, but like in Vim, there is also the concept of <dfn>modes</dfn> – a state which affects more generally how keys are interpreted.
<p>Vier has these modes:</p>
-<dl><dt><img src="assets/icons/modes/inject.png" alt="Inject mode icon" /> Inject mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The color of the pixels being drawn is replaced by the selected color, so this can also work as an “eraser” if the selected color is transparent. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/add.png" alt="Add mode icon" /> Add mode</dt><dd><strong>[NOT IMPLEMENTED]</strong> In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/select.png" alt="Select mode icon" /> Select mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and select a part of the picture using the currently selected tool. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/color.png" alt="Color mode icon" /> Color mode</dt><dd>In this mode, the user can move around a color palette (displayed at the top of the screen) to change the selected color (displayed in the upper left corner). If multiple palettes are available, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/command.png" alt="Command mode icon" /> Command mode</dt><dd>In this mode, the user can enter a command, displayed at the bottom of the screen, to perform complex actions such as opening a file. The commands are in the <a href="https://sprylang.se/">Spry</a> programming language, though this is not important for basic usage. The command is executed by pressing <kbd>⏎</kbd> or cancelled by pressing <kbd>Esc</kbd>.</dd></dl>
+<dl><dt><img src="assets/icons/modes/inject.png" alt="Inject mode icon" /> Inject mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The color of the pixels being drawn is replaced by the selected color, so this can also work as an “eraser” if the selected color is transparent. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/add.png" alt="Add mode icon" /> Add mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/select.png" alt="Select mode icon" /> Select mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and select a part of the picture using the currently selected tool. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/color.png" alt="Color mode icon" /> Color mode</dt><dd>In this mode, the user can move around a color palette (displayed at the top of the screen) to change the selected color (displayed in the upper left corner). If multiple palettes are available, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/command.png" alt="Command mode icon" /> Command mode</dt><dd>In this mode, the user can enter a command, displayed at the bottom of the screen, to perform complex actions such as opening a file. The commands are in the <a href="https://sprylang.se/">Spry</a> programming language, though this is not important for basic usage. The command is executed by pressing <kbd>⏎</kbd> or cancelled by pressing <kbd>Esc</kbd>.</dd></dl>
<p>The following tools are available:</p>
<dl><dt><img src="assets/icons/tools/brush.png" alt="Brush icon" /> Brush</dt><dd>The brush tool selects pixels that it moves over.</dd><dt><img src="assets/icons/tools/segment.png" alt="Segment icon" /> Segment</dt><dd>The segment tool selects a line segment.</dd><dt><img src="assets/icons/tools/rectangle.png" alt="Rectangle icon" /> Rectangle</dt><dd>The rectangle tool selects an axis-aligned rectangle.</dd><dt><img src="assets/icons/tools/flood.png" alt="Flood icon" /> Flood</dt><dd>The flood tool selects a contiguous area of pixels with the same color.</dd></dl></section>
<section><h2 class="xd-section-heading">Keyboard mappings</h2><p>The key mappings are inspired by Vim. They are currently not customizable.</p>
<table><tr><th>Key</th><th>Alone</th><th>Shift</th><th>Control</th></tr>
<tr><td><kbd>⎵</kbd></td><td>hold to draw</td></tr>
+<tr><td><kbd>A</kbd></td><td>Mode ← Add</td></tr>
<tr><td><kbd>B</kbd></td><td>Tool ← Brush</td></tr>
<tr><td><kbd>C</kbd></td><td>Mode ← Color</td></tr>
<tr><td><kbd>F</kbd></td><td>Tool ← Flood</td></tr>
@@ 44,9 45,11 @@ nimble <span class="token function">install</span>
<tr><td><kbd>U</kbd></td><td>undo</td></tr>
<tr><td><kbd>V</kbd></td><td>Mode ← Select</td></tr>
<tr><td><kbd>W</kbd></td><td>write picture</td><td>write all pictures</td></tr>
+<tr><td><kbd>X</kbd></td><td>swap colors</td></tr>
<tr><td><kbd>-</kbd></td><td>zoom out</td><td>zoom out all pictures</td></tr>
<tr><td><kbd>=</kbd></td><td>zoom in</td><td>zoom in all pictures</td></tr>
-<tr><td><kbd>;</kbd></td><td>Mode ← Command</td></tr></table></section>
+<tr><td><kbd>;</kbd></td><td>Mode ← Command</td></tr></table>
+Note that the mouse can also be used to draw and select colors. The right mouse button draws with the secondary color.</section>
<section><h2 class="xd-section-heading">Commands</h2><dl><dt><code>e image.png</code></dt><dd>open a file for editing (the filename is a symbol)</dd><dt><code>edit "image.png"</code></dt><dd>open a file for editing (the filename is a string)</dd><dt><code>flip-x</code></dt><dd>flip the current picture horizontally</dd><dt><code>flip-y</code></dt><dd>flip the current picture vertically</dd><dt><code>new</code></dt><dd>create a new picture with a transparent background and the default size</dd><dt><code>resize-nn 16 8</code></dt><dd>resize the current picture using the nearest-neighbor algorithm</dd><dt><code>w image.png</code></dt><dd>save the current picture under the specified filename (the filename is a symbol)</dd><dt><code>write "image.png"</code></dt><dd>save the current picture under the specified filename (the filename is a string)</dd></dl>
<p>Note that currently, edits done via commands are not added to undo history and break it.</p></section>
<section><h2 class="xd-section-heading">Planned features</h2><p>Roughly in order of priority.</p>
M website/index.xd => website/index.xd +4 -3
@@ 41,7 41,7 @@
[p Vier has these modes:]
[description-list
; [link-image Inject mode icon; assets/icons/modes/inject.png] Inject mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and draw with the currently selected tool. The color of the pixels being drawn is replaced by the selected color, so this can also work as an [" eraser] if the selected color is transparent. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
- ; [link-image Add mode icon; assets/icons/modes/add.png] Add mode; [<strong> [() NOT IMPLEMENTED]] In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
+ ; [link-image Add mode icon; assets/icons/modes/add.png] Add mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
; [link-image Select mode icon; assets/icons/modes/select.png] Select mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and select a part of the picture using the currently selected tool. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
; [link-image Color mode icon; assets/icons/modes/color.png] Color mode; In this mode, the user can move around a color palette (displayed at the top of the screen) to change the selected color (displayed in the upper left corner). If multiple palettes are available, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
; [link-image Command mode icon; assets/icons/modes/command.png] Command mode; In this mode, the user can enter a command, displayed at the bottom of the screen, to perform complex actions such as opening a file. The commands are in the [link Spry; https://sprylang.se/] programming language, though this is not important for basic usage. The command is executed by pressing [<kbd> ⏎] or cancelled by pressing [<kbd> Esc].
@@ 59,7 59,7 @@
[table
[header-row Key; Alone; Shift; Control]
[row [<kbd> ⎵]; hold to draw]
- [# row [<kbd> A]; Mode ← Add]
+ [row [<kbd> A]; Mode ← Add]
[row [<kbd> B]; Tool ← Brush]
[row [<kbd> C]; Mode ← Color]
[# row [<kbd> E]; Tool ← Ellipse]
@@ 75,11 75,12 @@
[row [<kbd> U]; undo]
[row [<kbd> V]; Mode ← Select]
[row [<kbd> W]; write picture; write all pictures]
- [# row [<kbd> X]; swap colors]
+ [row [<kbd> X]; swap colors]
[row [<kbd> -]; zoom out; zoom out all pictures]
[row [<kbd> =]; zoom in; zoom in all pictures]
[row [<kbd> [;]]; Mode ← Command]
]
+ Note that the mouse can also be used to draw and select colors. The right mouse button draws with the secondary color.
]
[section Commands;
[description-list