Quark #

Modules #

Quark v1.2.0 Documentation


Table of Contents

quark/types #

N #

Enum: Repeat #

Repeat #

  • Repeat
  • RepeatX
  • RepeatY
  • RepeatNo

Enum: FillPositionKind #

FillPositionKind #

  • Value Explicit Value
  • Ratio Percentage value
  • Start Starting position
  • End Ending position
  • Center Centered position

Enum: FillSizeKind #

FillSizeKind #

  • Auto Auto value
  • Value Explicit Value
  • Ratio Percentage value

BoxOriginKind #

Enum: Direction #

Direction #

Flex Layout direction

  • Row
  • RowReverse
  • Column
  • ColumnReverse

Enum: ItemsAlign #

ItemsAlign #

项目在主轴上的对齐方式

  • Start 左对齐
  • Center 居中
  • End 右对齐
  • SpaceBetween 两端对齐,项目之间的间隔都相等
  • SpaceAround 每个项目两侧的间隔相等。所以,项目之间的间隔比项目与边框的间隔大一倍
  • SpaceEvenly 每个项目两侧的间隔相等,这包括边框的间距
  • CenterCenter 把除两端以外的所有项目尽可能的居中对齐

Enum: CrossAlign #

CrossAlign #

项目在交叉轴内如何对齐

Enum: Wrap #

Wrap #

主轴溢出包裹,开启后当主轴溢出时分裂成多根交叉轴

  • NoWrap 只有一根交叉轴线
  • Wrap 溢出后会有多根交叉轴线
  • WrapReverse 多根交叉轴线反向排列

Enum: WrapAlign #

WrapAlign #

多根交叉轴线的对齐方式。如果项目只有一根交叉轴,该属性不起作用

  • Start 与交叉轴的起点对齐
  • Center 与交叉轴的中点对齐
  • End 与交叉轴的终点对齐
  • SpaceBetween 与交叉轴两端对齐,轴线之间的间隔平均分布
  • SpaceAround 每根轴线两侧的间隔都相等,所以轴线之间的间隔比轴线与边框的间隔大一倍
  • SpaceEvenly 每根轴线两侧的间隔都相等,这包括边框的间距
  • Stretch = 7 轴线占满整个交叉轴,平均分配剩余的交叉轴空间

Enum: Align #

Align #

View align

  • Normal
  • Start
  • Center
  • End
  • Both
  • NewStart = Both New independent line and left align
  • NewCenter New independent line and center align
  • NewEnd New independent line and right align
  • FloatStart Try not to wrap until the maximum limit and left align
  • FloatCenter Try not to wrap until the maximum limit and center align
  • FloatEnd Try not to wrap until the maximum limit and right align
  • Baseline = Normal box vertical align in text
  • Top box vertical align in text
  • Middle box vertical align in text
  • Bottom box vertical align in text
  • LeftTop = Start
  • CenterTop
  • RightTop
  • LeftMiddle
  • CenterMiddle
  • RightMiddle
  • LeftBottom
  • CenterBottom
  • RightBottom

Enum: BoxSizeKind #

BoxSizeKind #

The width/height value kind for the Box

  • None Do not use value
  • Auto 包裹内容 wrap content
  • Match 匹配父视图 match parent
  • Value 明确值 rem
  • Ratio 百分比 value %
  • Minus 减法(parent-value) value !

Enum: TextValueKind #

TextValueKind #

Basic type for the Text attributes

  • Inherit
  • Default
  • Value

Enum: TextAlign #

TextAlign #

  • Inherit inherit
  • Left 左对齐
  • Center 居中
  • Right 右对齐
  • Default = Left

Enum: TextDecoration #

TextDecoration #

  • Inherit inherit
  • None 没有
  • Overline 上划线
  • LineThrough 中划线
  • Underline 下划线
  • Default = None

Enum: TextOverflow #

TextOverflow #

  • Inherit inherit
  • Normal 不做任何处理
  • Clip 剪切
  • Ellipsis 剪切并显示省略号
  • EllipsisCenter 剪切并居中显示省略号
  • Default = Normal

Enum: TextWhiteSpace #

TextWhiteSpace #

  • Inherit inherit
  • Normal 合并空白序列,使用自动wrap
  • NoWrap 合并空白序列,不使用自动wrap
  • Pre 保留所有空白,不使用自动wrap
  • PreWrap 保留所有空白,使用自动wrap
  • PreLine 合并空白符序列,但保留换行符,使用自动wrap
  • Default = Normal

Enum: TextWordBreak #

TextWordBreak #

  • Inherit inherit
  • Normal 保持单词在同一行
  • BreakWord 保持单词在同一行,除非单词长度超过一行才截断
  • BreakAll 以字为单位行空间不足换行
  • KeepAll 所有连续的字符都当成一个单词,除非出现空白符、换行符、标点符
  • Default = Normal

Enum: TextWeight #

TextWeight #

  • Inherit
  • Thin
  • Ultralight
  • Light
  • Regular
  • Medium
  • Semibold
  • Bold
  • Heavy
  • Black
  • ExtraBlack
  • Default = Regular

Enum: TextWidth #

TextWidth #

  • Inherit
  • UltraCondensed
  • ExtraCondensed
  • Condensed
  • SemiCondensed
  • Normal
  • SemiExpanded
  • Expanded
  • ExtraExpanded
  • UltraExpanded
  • Default = Normal

Enum: TextSlant #

TextSlant #

  • Inherit
  • Normal
  • Italic
  • Oblique
  • Default = Normal

TextStyle #

Enum: KeyboardType #

KeyboardType #

  • Normal
  • Ascii
  • Number
  • Url
  • NumberPad
  • Phone
  • NamePhone
  • Email
  • Decimal
  • Search
  • AsciiNumber

Enum: KeyboardReturnType #

KeyboardReturnType #

  • Normal
  • Go
  • Join
  • Next
  • Route
  • Search
  • Send
  • Done
  • Emergency
  • Continue

Enum: CursorStyle #

CursorStyle #

  • Normal
  • None
  • NoneUntilMouseMoves
  • Arrow
  • Ibeam
  • PointingHand
  • Pointer
  • ClosedHand
  • OpenHand
  • ResizeLeft
  • ResizeRight
  • ResizeLeftRight
  • ResizeUp
  • ResizeDown
  • ResizeUpDown
  • Crosshair
  • DisappearingItem
  • OperationNotAllowed
  • DragLink
  • DragCopy
  • ContextualMenu
  • IbeamForVertical

Enum: FindDirection #

FindDirection #

  • None
  • Left
  • Top
  • Right
  • Bottom

RepeatIn #

  • @type RepeatIn = "repeat"|"repeatX"|"repeatY"|"repeatNo"|Repeat

DirectionIn #

  • @type DirectionIn = "row"|"rowReverse"|"column"|"columnReverse"|Direction

ItemsAlignIn #

  • @type ItemsAlignIn = "start"|"center"|"end"|"spaceBetween"|"spaceAround"|"spaceEvenly"|"centerCenter"|ItemsAlign

CrossAlignIn #

  • @type CrossAlignIn = "start"|"center"|"end"|"both"|CrossAlign

WrapIn #

  • @type WrapIn = "noWrap"|"wrap"|"wrapReverse"|Wrap

WrapAlignIn #

  • @type WrapAlignIn = "start"|"center"|"end"|"spaceBetween"|"spaceAround"|"spaceEvenly"|"stretch"|WrapAlign

AlignIn #

  • @type AlignIn = "normal"|"start"|"center"|"end"|"both"|"newStart"|"newCenter"|"newEnd"|"floatStart"|"floatCenter"|"floatEnd"|"baseline"|"top"|"middle"|"bottom"|"leftTop"|"centerTop"|"rightTop"|"leftMiddle"|"centerMiddle"|"rightMiddle"|"leftBottom"|"centerBottom"|"rightBottom"|Align

TextAlignIn #

  • @type TextAlignIn = "center"|"inherit"|"left"|"right"|"default"|TextAlign

TextDecorationIn #

  • @type TextDecorationIn = "inherit"|"default"|"none"|"overline"|"lineThrough"|"underline"|TextDecoration

TextOverflowIn #

  • @type TextOverflowIn = "normal"|"inherit"|"default"|"clip"|"ellipsis"|"ellipsisCenter"|TextOverflow

TextWhiteSpaceIn #

  • @type TextWhiteSpaceIn = "noWrap"|"normal"|"inherit"|"default"|"pre"|"preWrap"|"preLine"|TextWhiteSpace

TextWordBreakIn #

  • @type TextWordBreakIn = "normal"|"inherit"|"default"|"breakWord"|"breakAll"|"keepAll"|TextWordBreak

TextWeightIn #

  • @type TextWeightIn = "inherit"|"default"|"thin"|"ultralight"|"light"|"regular"|"medium"|"semibold"|"bold"|"heavy"|"black"|"extraBlack"|TextWeight

TextWidthIn #

  • @type TextWidthIn = "normal"|"inherit"|"default"|"ultraCondensed"|"extraCondensed"|"condensed"|"semiCondensed"|"semiExpanded"|"expanded"|"extraExpanded"|"ultraExpanded"|TextWidth

TextSlantIn #

  • @type TextSlantIn = "normal"|"inherit"|"default"|"italic"|"oblique"|TextSlant

KeyboardTypeIn #

  • @type KeyboardTypeIn = "number"|"normal"|"ascii"|"url"|"numberPad"|"phone"|"namePhone"|"email"|"decimal"|"search"|"asciiNumber"|KeyboardType

KeyboardReturnTypeIn #

  • @type KeyboardReturnTypeIn = "normal"|"search"|"go"|"join"|"next"|"route"|"send"|"done"|"emergency"|"continue"|KeyboardReturnType

CursorStyleIn #

  • @type CursorStyleIn = "normal"|"none"|"noneUntilMouseMoves"|"arrow"|"ibeam"|"pointingHand"|"pointer"|"closedHand"|"openHand"|"resizeLeft"|"resizeRight"|"resizeLeftRight"|"resizeUp"|"resizeDown"|"resizeUpDown"|"crosshair"|"disappearingItem"|"operationNotAllowed"|"dragLink"|"dragCopy"|"contextualMenu"|"ibeamForVertical"|CursorStyle

FindDirectionIn #

  • @type FindDirectionIn = "none"|"left"|"top"|"right"|"bottom"|FindDirection

Class: Base #

Base #

  • @template <T>

base.toString() #

base.toStringStyled(indent?) #

Class: Vec2 #

Vec2 #

vec2.x #

  • x: N

vec2.y #

  • y: N

Vec2In #

  • @type Vec2In = "0 0"|"vec2(0,0)"|N|[0,0]|Vec2

Class: Vec3 #

Vec3 #

vec3.x #

  • x: N

vec3.y #

  • y: N

vec3.z #

  • z: N

Vec3In #

  • @type Vec3In = "0 0 1"|"vec3(0,0,1)"|N|[0,0,1]|Vec3

Class: Vec4 #

Vec4 #

vec4.x #

  • x: N

vec4.y #

  • y: N

vec4.z #

  • z: N

vec4.w #

  • w: N

Vec4In #

  • @type Vec4In = "0 0 1 1"|"vec4(0,0,1,1)"|N|[0,0,1,1]|Vec4

Class: Curve #

Curve #

curve.p1 #

curve.p2 #

curve.p1x #

  • @get p1x: N

curve.p1y #

  • @get p1y: N

curve.p2x #

  • @get p2x: N

curve.p2y #

  • @get p2y: N

CurveIn #

  • @type CurveIn = "linear"|"ease"|"easeIn"|"easeOut"|"easeInOut"|"curve(0,0,1,1)"|[0,0,1,1]|Curve

Class: Rect #

Rect #

rect.origin #

rect.size #

rect.x #

  • @get x: N

rect.y #

  • @get y: N

rect.width #

  • @get width: N

rect.height #

  • @get height: N

RectIn #

  • @type RectIn = "rect(0,0,100,100)"|"rect(0,0)"|[0,0,100,100]|Rect

Class: Mat #

Mat #

mat.m0 #

  • m0: N

mat.m1 #

  • m1: N

mat.m2 #

  • m2: N

mat.m3 #

  • m3: N

mat.m4 #

  • m4: N

mat.m5 #

  • m5: N

MatIn #

  • @type MatIn = N|Mat|"mat(0,0,0,0,0,0)"

Class: Mat4 #

Mat4 #

mat4.m0 #

  • m0: N

mat4.m1 #

  • m1: N

mat4.m2 #

  • m2: N

mat4.m3 #

  • m3: N

mat4.m4 #

  • m4: N

mat4.m5 #

  • m5: N

mat4.m6 #

  • m6: N

mat4.m7 #

  • m7: N

mat4.m8 #

  • m8: N

mat4.m9 #

  • m9: N

mat4.m10 #

  • m10: N

mat4.m11 #

  • m11: N

mat4.m12 #

  • m12: N

mat4.m13 #

  • m13: N

mat4.m14 #

  • m14: N

mat4.m15 #

  • m15: N

Class: Color #

Color #

color.r #

  • r: N

color.g #

  • g: N

color.b #

  • b: N

color.a #

  • a: N

ColorStrIn #

  • @type ColorStrIn = "#fff"|"rgb(0,0,0)"|"rgba(0,0,0,255)"

ColorIn #

Class: Shadow #

Shadow #

shadow.x #

  • x: N

shadow.y #

  • y: N

shadow.size #

  • size: N

shadow.color #

shadow.r #

  • @get r: N

shadow.g #

  • @get g: N

shadow.b #

  • @get b: N

shadow.a #

  • @get a: N

ShadowIn #

  • @type ShadowIn = "2 2 2 rgb(100,100,100)"|Shadow

Class: BoxBorder #

BoxBorder #

boxborder.width #

  • width: N

boxborder.color #

boxborder.r #

  • @get r: N

boxborder.g #

  • @get g: N

boxborder.b #

  • @get b: N

boxborder.a #

  • @get a: N

BoxBorderIn #

  • @type BoxBorderIn = "1 rgb(100,100,100)"|BoxBorder

Class: FillPosition #

FillPosition #

fillposition.value #

  • value: N

fillposition.kind #

FillPositionKindStr #

  • @type FillPositionKindStr = "start"|"end"|"center"

FillPositionIn #

Class: FillSize #

FillSize #

fillsize.value #

  • value: N

fillsize.kind #

FillSizeKindStr #

  • @type FillSizeKindStr = "auto"

FillSizeIn #

Class: BoxSize #

BoxSize #

boxsize.value #

  • value: N

boxsize.kind #

BoxSizeKindStr #

  • @type BoxSizeKindStr = "auto"|"none"|"match"

BoxSizeIn #

Class: BoxOrigin #

BoxOrigin #

boxorigin.value #

  • value: N

boxorigin.kind #

BoxOriginKindStr #

BoxOriginIn #

Class: TextBase #

TextBase #

  • @template <Derived,Value>
  • @extends Base<Derived>

textbase.value #

  • value: Value

textbase.kind #

Class: TextColor #

TextColor #

textcolor.r #

  • @get r: N

textcolor.g #

  • @get g: N

textcolor.b #

  • @get b: N

textcolor.a #

  • @get a: N

TextValueKindInStr #

  • @type TextValueKindInStr = "inherit"|"default"

TextColorIn #

Class: TextSize #

TextSize #

TextSizeIn #

TextLineHeightIn #

TextLineHeight #

Class: TextShadow #

TextShadow #

textshadow.x #

  • @get x: N

textshadow.y #

  • @get y: N

textshadow.size #

  • @get size: N

textshadow.color #

textshadow.r #

  • @get r: N

textshadow.g #

  • @get g: N

textshadow.b #

  • @get b: N

textshadow.a #

  • @get a: N

TextShadowIn #

FFID #

Class: TextFamily #

TextFamily #

textfamily.families() #

EmptyFFID #

  • @const EmptyFFID: FFID

TextFamilyIn #

Class: BoxFilter #

BoxFilter #

  • @abstract

boxfilter.type #

  • @get type: N

boxfilter.next #

BoxFilterIn #

For example:

image(res/image.png, auto 100%, x=start, y=20%, repeat)

radial(#ff00ff 0%, #ff0 50%, #00f 100%)

linear(90, #ff00ff 0%, #ff0 50%, #00f 100%)

Class: FillImage #

FillImage #

fillimage.src #

fillimage.width #

fillimage.height #

fillimage.x #

fillimage.y #

fillimage.repeat #

fillimage.constructor(src,init?) #

Class: FillGradientRadial #

FillGradientRadial #

fillgradientradial.positions #

  • @get positions: N[]

fillgradientradial.colors #

fillgradientradial.constructor(pos,colors) #

  • @param pos: N[]
  • @param colors: Color[]

Class: FillGradientLinear #

FillGradientLinear #

fillgradientlinear.angle #

  • angle: N

fillgradientlinear.constructor(pos,coloes,angle) #

  • @param pos: N[]
  • @param coloes: Color[]
  • @param angle: N

Class: BoxShadow #

BoxShadow #

boxshadow.value #

boxshadow.constructor(value) #

BoxShadowIn #

For example:

10 10 2 #ff00aa

['10 10 2 #ff00aa']

10 10 2 rgba(255,255,0,255)

newColor(r,g,b,a) #

  • @param r: N
  • @param g: N
  • @param b: N
  • @param a: N
  • @return Color

newVec2(x,y) #

  • @param x: N
  • @param y: N
  • @return Vec2

newVec3(x,y,z) #

  • @param x: N
  • @param y: N
  • @param z: N
  • @return Vec3

newVec4(x,y,z,w) #

  • @param x: N
  • @param y: N
  • @param z: N
  • @param w: N
  • @return Vec4

newRect(x,y,width,height) #

  • @param x: N
  • @param y: N
  • @param width: N
  • @param height: N
  • @return Rect

newMat(...value) #

  • @param value: N[]
  • @return Mat

newMat4(...value) #

  • @param value: N[]
  • @return Mat4

newCurve(p1x,p1y,p2x,p2y) #

  • @param p1x: N
  • @param p1y: N
  • @param p2x: N
  • @param p2y: N
  • @return Curve

newShadow(x,y,size,r,g,b,a) #

  • @param x: N
  • @param y: N
  • @param size: N
  • @param r: N
  • @param g: N
  • @param b: N
  • @param a: N
  • @return Shadow

newBoxBorder(width,r,b,a) #

  • @param width: N
  • @param r: N
  • @param b: N
  • @param a: N
  • @return BoxBorder
  • @param g: N

newFillPosition(kink,value) #

newFillSize(kink,value) #

newBoxOrigin(kink,value) #

newBoxSize(kink,value) #

newTextColor(kink,r,g,b,a) #

newTextSize(kink,value) #

newTextLineHeight(kink,value) #

newTextShadow(kind,offset_x,offset_y,size,r,g,b,a) #

newTextFamily(kind,ffid?) #

parseRepeat(val,desc?) #

parseDirection(val,desc?) #

parseItemsAlign(val,desc?) #

parseCrossAlign(val,desc?) #

parseWrap(val,desc?) #

parseWrapAlign(val,desc?) #

parseAlign(val,desc?) #

parseTextAlign(val,desc?) #

parseTextDecoration(val,desc?) #

parseTextOverflow(val,desc?) #

parseTextWhiteSpace(val,desc?) #

parseTextWordBreak(val,desc?) #

parseTextWeight(val,desc?) #

parseTextWidth(val,desc?) #

parseTextSlant(val,desc?) #

parseKeyboardType(val,desc?) #

parseKeyboardReturnType(val,desc?) #

parseCursorStyle(val,desc?) #

parseFindDirection(val,desc?) #

parseVec2(val,desc?) #

parseVec3(val,desc?) #

parseVec4(val,desc?) #

parseCurve(val,desc?) #

parseRect(val,desc?) #

parseMat(val,desc?) #

parseMat4(val,desc?) #

  • @param val: Mat4In
  • @param desc?: string
  • @return Mat4

parseColor(val,desc?,ref?) #

parseShadow(val,desc?,ref?) #

parseBoxBorder(val,desc?) #

parseFillPosition(val,desc?) #

parseFillSize(val,desc?) #

parseBoxOrigin(val,desc?) #

parseBoxSize(val,desc?) #

parseTextColor(val,desc?) #

parseTextSize(val,desc?) #

parseTextLineHeight(val,desc?) #

parseTextShadow(val,desc?) #

parseTextFamily(val,desc?) #

parseBoxFilter(val,desc?) #

parseBoxShadow(val,desc?) #

parseBoxFilterPtr #

  • @type parseBoxFilterPtr = parseBoxFilter

parseBoxShadowPtr #

  • @type parseBoxShadowPtr = parseBoxShadow