Appearance
Vext Settings Store
Pinia store that holds settings for different VEXT tools (brush & shape).
State
Name | Description | Type | Values | Default |
---|---|---|---|---|
pointerMenu | whether the pointer menu is open | boolean | - | false |
onAction | whether to open the pointer menu after an annotation action | boolean | - | true |
onGesture | whether to open the pointer menu after with a specific gesture | boolean | - | true |
closeOnClick | whether to close the pointer menu after clicking one of its items | boolean | - | true |
historyLimit | how many interactions to store in the history log | number | - | 50 |
activeColor | currently active color (primary or secondary) | number | [0,1] | 0 |
color0 | primary color | string | - | "#ffffff" |
color1 | secondary color | string | - | "#000000" |
brushSize | size of the drawing brush | number | - | 1 |
brushDecimation | how much to decimate drawn lines | number | - | 5 |
shape | selected shape in the shape mode | string | ["text", "circle", "rectangle", "triangle"] | "text" |
shapeDim0 | size of the first dimension for the new shape | number | - | 10 |
shapeDim1 | size of the second dimension for the new shape | number | - | 10 |
defaultColors | array of colors to use for layers | number | - | ["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"] |
Getters
color
Returns the currently selected color string.
Methods
emit
Emit an event from the note event handler.
@param {String}
name - event name@param {*}
data - event payload
on
Register an event handler.
@param {String}
name - event name@param {Function}
hadler - event callback handler@returns
handle id
off
Remove an event handler for the given event.
@param {String}
name - event name@param {Number}
handler - event handle@returns
true if the event was removed
defaultColorAt
Returns the default color at a specific index. Colors are wrapped -> starts at the beginning in index is out of bounds.
@param {Number}
index - color index@returns {String}
the color
setHistoryLimit
Sets the history interaction limit (minimum value of 1 is enforced)
@param {Number}
limit
setBrushSize
Sets the brush size to use for drawing.
@param {Number}
size - brush size in pixels@param {Boolean}
record - whether to record this action (defaulttrue
)
setBrushDecimation
Sets the brush decimation value.
@param {Number}
value - value in pixels@param {Boolean}
record - whether to record this action (defaulttrue
)
selectColor
Select a color by id (either primary = 0 or secondary = 1). If the passed id is not 0 or 1, the selected color is toggled.
@param {Number}
id - color id@param {Boolean}
record - whether to record this action (defaulttrue
)
setColor
Sets the color to use for the currently active color.
@param {String}
color - color value@param {Boolean}
record - whether to record this action (defaulttrue
)
setColorPrimary
Sets the color to use for the primary color.
@param {String}
color - color value@param {Boolean}
record - whether to record this action (defaulttrue
)
setColorSecondary
Sets the color to use for the secondary color.
@param {String}
color - color value@param {Boolean}
record - whether to record this action (defaulttrue
)
setShape
Sets the shape to use in the shape mode
@param {String}
shape - shape type@param {Boolean}
record - whether to record this action (defaulttrue
)