Package-level declarations

Types

Link copied to clipboard
data class ColorRgba(val red: Int, val green: Int, val blue: Int, val alpha: Int = 255)

A color expressed as four 0-255 channels. core defines its own color type instead of reusing a platform color class (e.g. Android's Color), since core must stay free of any platform/UI dependency.

Link copied to clipboard

How many of a shape's vertices get an editing handle.

Link copied to clipboard
data class HandleStyle(val vertexDiameter: Float = 27.0f, val midpointDiameter: Float = 24.0f, val touchTargetDiameter: Float = 48.0f, val fillColor: ColorRgba = ColorRgba(red = 255, green = 255, blue = 255), val ringColor: ColorRgba = ColorRgba(red = 16, green = 16, blue = 16), val plusColor: ColorRgba = ColorRgba(red = 16, green = 16, blue = 16), val selectedFillColor: ColorRgba = ColorRgba(red = 255, green = 149, blue = 0), val detail: HandleDetail = HandleDetail.Adaptive)

How the editing handles look: the round dots on each vertex of a shape being edited, and the smaller "+" dots on the middle of each edge that add a new vertex when dragged. Also used for the dots shown on a shape while it is still being drawn.

Link copied to clipboard

What a ShapeStyle.Hatch is drawn with.

Link copied to clipboard
data class HighlightStyle(val selectedColor: ColorRgba = ColorRgba(red = 255, green = 92, blue = 138), val editingColor: ColorRgba = ColorRgba(red = 45, green = 212, blue = 191))

The colour of the outline drawn around the shape the user has selected or is editing. It is drawn around the shape rather than recolouring it, so a shape's own fill and style are never touched. A colour's alpha is honoured: the highlight pulses between that opacity and a faded one.

Link copied to clipboard

How an ShapeStyle.ImageFill's picture is sized against the shape's bounding box. Always centred, aspect ratio kept unless noted.

Link copied to clipboard
sealed interface ImageRef

Where an image comes from. core can't name a platform image type (a Bitmap, a UIImage...) and there is no file path that works everywhere (the web and iOS have none), so an image is either a URL or the raw bytes of an encoded image file.

Link copied to clipboard
sealed interface ShapeStyle

A shape's primary appearance — its interior fill for shapes that have one (e.g. com.tcsappdev.worldwinddraw.core.geometry.DrawnPolygon), or its stroke/line color for shapes that don't (e.g. com.tcsappdev.worldwinddraw.core.geometry.DrawnMarker). DrawableEntity deliberately has just one style: ShapeStyle field shared by every entity kind (see ChangeStyleCommand's KDoc) — which of "fill" or "stroke" a given ShapeStyle resolves to is a wwk-adapter mapper decision (interior for a polygon, outline for a polyline), not something core encodes.

Link copied to clipboard

The visual "mode" a com.tcsappdev.worldwinddraw.core.geometry.DrawableEntity is currently in, driven by user interaction. A Theme maps each of these states to the ShapeStyle that should be shown while a shape is in that state.