pub enum Role {
Show 84 variants
ShapeFill,
ShapeStroke,
ShapeTitle,
LockedShapeFill,
LockedShapeTitle,
ShapeType,
LockedShapeType,
LockedHintIcon,
AccentDefault,
Accent0,
Accent1,
Accent2,
Accent3,
Accent4,
Accent5,
Accent6,
Accent7,
TextBoxFill,
TextBoxStroke,
AreaStroke,
RouteNormal,
RouteSelected,
RouteHighlighted,
RouteInProgress,
RouteProposedEndpoint,
PinStem,
PinText,
PinTag,
PinStemSelected,
PinTagSelected,
PinLabelPlaceholder,
DragPreviewStroke,
DragActiveFill,
DragActiveStroke,
EdgeDragPreview,
MoveRefusedStroke,
StandingConflict,
SelectionFrame,
SelectionFrameOutline,
ControlHandleFill,
ControlHandleStroke,
WaypointFill,
ResizeCornerFill,
ResizeCornerStroke,
ResizeCornerActiveFill,
ResizeCornerActiveStroke,
ImageDragBox,
MarqueeFill,
NewBlockPreviewStroke,
NewPinPreviewFill,
NewPinPreviewStroke,
RouteStartTarget,
CanvasBackground,
GridLine,
PinDragIndicator,
DebugMark,
AlignmentGuide,
SizeReadout,
LiveDot,
DotWriting,
DotReadOnly,
DotScratch,
ViewingTint,
ViewingInk,
ViewingReturnInk,
Toast,
ToastText,
TagBadge,
TagBadgeText,
AuthorAvatar0,
AuthorAvatar1,
AuthorAvatar2,
AuthorAvatar3,
AuthorAvatar4,
AuthorAvatarText,
TitleBlockBorder,
ChangeRing,
EditorText,
EditorFill,
EditorCaret,
EditorSelection,
EditorHint,
EditorBorder,
Transparent,
}Expand description
A semantic color slot. Drawing code passes a Role to every draw call; the
renderer resolves it through the active Theme (role → Base → color),
so call sites name intent, never a literal color. Add a variant here for
each semantically-distinct color in the app.
Transparent must remain the last variant: N_ROLES is derived from it.
Variants§
ShapeFill
ShapeStroke
ShapeTitle
LockedShapeFill
LockedShapeTitle
ShapeType
LockedShapeType
LockedHintIcon
AccentDefault
Accent0
Accent1
Accent2
Accent3
Accent4
Accent5
Accent6
Accent7
TextBoxFill
TextBoxStroke
AreaStroke
RouteNormal
RouteSelected
RouteHighlighted
RouteInProgress
RouteProposedEndpoint
PinStem
PinText
PinTag
PinStemSelected
PinTagSelected
PinLabelPlaceholder
Faint “Add Name”/“Add Type” placeholder shown at an empty pin label slot while the pin’s shape is selected.
DragPreviewStroke
DragActiveFill
DragActiveStroke
EdgeDragPreview
MoveRefusedStroke
A move the destination refuses, so the drag is showing what will not be taken. The same base the read-only dot is drawn in: it already means “no” here.
StandingConflict
A conflict the document already holds — two routing shapes sharing cells, which a paste can create and nothing refuses. Amber, not red: it is a fault to clear, not a gesture being turned away.
SelectionFrame
SelectionFrameOutline
ControlHandleFill
ControlHandleStroke
WaypointFill
ResizeCornerFill
ResizeCornerStroke
ResizeCornerActiveFill
ResizeCornerActiveStroke
ImageDragBox
MarqueeFill
NewBlockPreviewStroke
NewPinPreviewFill
NewPinPreviewStroke
RouteStartTarget
The grow-out target shown on a pin/anchor when hovering it in the select tool (to start a route) or nearing it while routing (to end one).
CanvasBackground
GridLine
PinDragIndicator
DebugMark
AlignmentGuide
Thin line shown while dragging when an edge/center/pin-stub lines up with another shape’s. A base color, not an accent.
SizeReadout
The grid-cell size readout shown inside a block’s upper-left corner while it is being resized. A base color, like the other transient drag hints.
LiveDot
The liveness dot at the head of the top bar, in its four states: recorded, a write in flight, nothing writable, and a scratch session with no file behind it. Hues rather than base tones — they say which state, not how loud — except the scratch one, which is a base tone on purpose: it is the absence of a state, not one of them.
DotWriting
DotReadOnly
DotScratch
ViewingTint
The top bar while the time machine is open: the amber wash over the bar’s own glass, the ink the centre’s words and the dot take, and the word on the one filled control in the shell. The wash carries its own alpha, because it goes over the fill the bar already has — the bar changes state rather than becoming another object.
ViewingInk
ViewingReturnInk
Toast
The toast that says what a file operation did: the slab and the words
on it. The mockup’s is a dark glass plate with white text, which is
one scheme’s answer to a question the palette answers for both — so it
takes the inverse-video pairing Role::TagBadge argues for, like
every other thing in this app that has to be read over whatever is
behind it.
ToastText
TagBadge
A named rev’s badge in the history list: the chip behind the tag, and the text on it. Inverse video off the base ramp — the foreground slot filled, the background slot written on it — which is the only pairing that clears WCAG AA in every scheme this app ships, light and dark. A badge whose text you cannot read is not a badge.
TagBadgeText
AuthorAvatar0
The initials disc beside a history row. One of five accent slots, picked by hashing the author’s name, so the same hand keeps the same colour down the list without anybody assigning one.
Roles rather than arithmetic on the palette: the avatar wants categorical colour, which is what the accent ramp is for, and naming the five means a scheme can re-point them.
AuthorAvatar1
AuthorAvatar2
AuthorAvatar3
AuthorAvatar4
AuthorAvatarText
The initials themselves, read over any of the five.
TitleBlockBorder
The outline around a title block, in both homes it has: the editor’s
corner of the canvas and the printed sheet’s footer. Sheet furniture,
not a document object — which is why it does not borrow
Role::AreaStroke, whose color a user edits to restyle their own
boundary areas.
ChangeRing
The ring a document step leaves round what it changed. A guide role, so
a base tone — it points at the drawing for a moment, like
Role::AlignmentGuide and Role::SizeReadout beside it, and is not
content with an accent of its own.
EditorText
The in-place editor where it replaces no label of its own colour: its ink and its field. An editor inside a block body takes the label’s roles instead.
EditorFill
EditorCaret
The caret and the selection highlight, every editor’s.
EditorSelection
EditorHint
The placeholder’s ink while the draft is empty.
EditorBorder
The ring round every editor’s field, so it reads as a field standing over the drawing rather than as more of the drawing.
Transparent
Resolves to a fully transparent color (transparent fills, no-op strokes).
Keep this the last variant — N_ROLES depends on it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.