diff --git a/animation.go b/animation.go index 6b0272f..5be2054 100644 --- a/animation.go +++ b/animation.go @@ -259,15 +259,15 @@ func parseAnimation(obj DataObject) AnimationProperty { // NewAnimationProperty creates a new animation object and return its interface // // The following properties can be used: -// - "id" (ID) - specifies the animation identifier. Used only for animation script. -// - "duration" (Duration) - specifies the length of time in seconds that an animation takes to complete one cycle; -// - "delay" (Delay) - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform +// - "id" ([ID]) - specifies the animation identifier. Used only for animation script. +// - "duration" ([Duration]) - specifies the length of time in seconds that an animation takes to complete one cycle; +// - "delay" ([Delay]) - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform // the animation. The animation can start later, immediately from its beginning or immediately and partway through the animation; -// - "timing-function" (TimingFunction) - specifies how an animation progresses through the duration of each cycle; -// - "iteration-count" (IterationCount) - specifies the number of times an animation sequence should be played before stopping. Used only for animation script; -// - "animation-direction" (AnimationDirection) - specifies whether an animation should play forward, backward, +// - "timing-function" ([TimingFunction]) - specifies how an animation progresses through the duration of each cycle; +// - "iteration-count" ([IterationCount]) - specifies the number of times an animation sequence should be played before stopping. Used only for animation script; +// - "animation-direction" ([AnimationDirection]) - specifies whether an animation should play forward, backward, // or alternate back and forth between playing the sequence forward and backward. Used only for animation script; -// - "property" (PropertyTag) - describes a scenario for changing a View's property. Used only for animation script. +// - "property" ([PropertyTag]) - describes a scenario for changing a View's property. Used only for animation script. func NewAnimationProperty(params Params) AnimationProperty { animation := new(animationData) animation.init() @@ -279,7 +279,7 @@ func NewAnimationProperty(params Params) AnimationProperty { } // NewTransitionAnimation creates animation data for the transition. -// - timingFunc - specifies how an animation progresses through the duration of each cycle. If it is "" then "easy" function is used; +// - timingFunc - specifies how an animation progresses through the duration of each cycle. If it is "" then "easy" function is used (see [TimingFunction]); // - duration - specifies the length of time in seconds that an animation takes to complete one cycle. Must be > 0; // - delay - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform // the animation. The animation can start later, immediately from its beginning or immediately and partway through the animation. @@ -311,7 +311,7 @@ func NewTransitionAnimation(timingFunc string, duration float64, delay float64) // NewTransitionAnimation creates the animation scenario. // - id - specifies the animation identifier. -// - timingFunc - specifies how an animation progresses through the duration of each cycle. If it is "" then "easy" function is used; +// - timingFunc - specifies how an animation progresses through the duration of each cycle. If it is "" then "easy" function is used (see [TimingFunction]); // - duration - specifies the length of time in seconds that an animation takes to complete one cycle. Must be > 0; // - delay - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform // the animation. The animation can start later, immediately from its beginning or immediately and partway through the animation. diff --git a/backgroundConicGradient.go b/backgroundConicGradient.go index 207fcf5..2162724 100644 --- a/backgroundConicGradient.go +++ b/backgroundConicGradient.go @@ -21,11 +21,11 @@ type BackgroundGradientAngle struct { // NewBackgroundConicGradient creates the new background conic gradient // // The following properties can be used: -// - "gradient" [Gradient] - Describes gradient stop points. This is a mandatory property while describing background gradients. -// - "center-x" [CenterX] - center X point of the gradient. -// - "center-y" [CenterY] - center Y point of the gradient. -// - "from" [From] - start angle position of the gradient. -// - "repeating" [Repeating] - Defines whether stop points needs to be repeated after the last one. +// - "gradient" ([Gradient]) - Describes gradient stop points. This is a mandatory property while describing background gradients. +// - "center-x" ([CenterX]) - center X point of the gradient. +// - "center-y" ([CenterY]) - center Y point of the gradient. +// - "from" ([From]) - start angle position of the gradient. +// - "repeating" ([Repeating]) - Defines whether stop points needs to be repeated after the last one. func NewBackgroundConicGradient(params Params) BackgroundElement { result := new(backgroundConicGradient) result.init() diff --git a/backgroundImage.go b/backgroundImage.go index 37dcd95..d8dd18b 100644 --- a/backgroundImage.go +++ b/backgroundImage.go @@ -74,14 +74,14 @@ type backgroundImage struct { // NewBackgroundImage creates the new background image // // The following properties can be used: -// - "src" [Source] - the name of the image in the "images" folder of the resources, or the URL of the image or inline-image. -// - "width" [Width] - the width of the image. -// - "height" [Height] - the height of the image. -// - "image-horizontal-align" [ImageHorizontalAlign] - the horizontal alignment of the image relative to view's bounds. -// - "image-vertical-align" [ImageVerticalAlign] - the vertical alignment of the image relative to view's bounds. -// - "repeat" [Repeat] - the repetition of the image. -// - "fit" [Fit] - the image scaling parameters. -// - "attachment" [Attachment] - defines whether a background image's position is fixed within the viewport or scrolls with its containing block. +// - "src" ([Source]) - the name of the image in the "images" folder of the resources, or the URL of the image or inline-image. +// - "width" ([Width]) - the width of the image. +// - "height" ([Height]) - the height of the image. +// - "image-horizontal-align" ([ImageHorizontalAlign]) - the horizontal alignment of the image relative to view's bounds. +// - "image-vertical-align" ([ImageVerticalAlign]) - the vertical alignment of the image relative to view's bounds. +// - "repeat" ([Repeat]) - the repetition of the image. +// - "fit" ([Fit]) - the image scaling parameters. +// - "attachment" ([Attachment]) - defines whether a background image's position is fixed within the viewport or scrolls with its containing block. func NewBackgroundImage(params Params) BackgroundElement { result := new(backgroundImage) result.init() diff --git a/backgroundLinearGradient.go b/backgroundLinearGradient.go index b8838c9..a1a0b3e 100644 --- a/backgroundLinearGradient.go +++ b/backgroundLinearGradient.go @@ -52,9 +52,9 @@ type backgroundLinearGradient struct { // NewBackgroundLinearGradient creates the new background linear gradient. // // The following properties can be used: -// - "gradient" [Gradient] - Describes gradient stop points. This is a mandatory property while describing background gradients. -// - "direction" [Direction] - Defines the direction of the gradient line. -// - "repeating" [Repeating] - Defines whether stop points needs to be repeated after the last one. +// - "gradient" ([Gradient]) - Describes gradient stop points. This is a mandatory property while describing background gradients. +// - "direction" ([Direction]) - Defines the direction of the gradient line. +// - "repeating" ([Repeating]) - Defines whether stop points needs to be repeated after the last one. func NewBackgroundLinearGradient(params Params) BackgroundElement { result := new(backgroundLinearGradient) result.init() diff --git a/backgroundRadialGradient.go b/backgroundRadialGradient.go index d02ef3f..e8029aa 100644 --- a/backgroundRadialGradient.go +++ b/backgroundRadialGradient.go @@ -42,11 +42,11 @@ type backgroundRadialGradient struct { // NewBackgroundRadialGradient creates the new background radial gradient. // // The following properties can be used: -// - "gradient" (Gradient) - Describes gradient stop points. This is a mandatory property while describing background gradients. -// - "center-x" (CenterX), "center-y" (CenterY) - Defines the gradient center point coordinates. -// - "radial-gradient-radius" (RadialGradientRadius) - Defines radius of the radial gradient. -// - "radial-gradient-shape" (RadialGradientShape) - Defines shape of the radial gradient. -// - "repeating" (Repeating) - Defines whether stop points needs to be repeated after the last one. +// - "gradient" ([Gradient]) - Describes gradient stop points. This is a mandatory property while describing background gradients. +// - "center-x" ([CenterX]), "center-y" ([CenterY]) - Defines the gradient center point coordinates. +// - "radial-gradient-radius" ([RadialGradientRadius]) - Defines radius of the radial gradient. +// - "radial-gradient-shape" ([RadialGradientShape]) - Defines shape of the radial gradient. +// - "repeating" ([Repeating]) - Defines whether stop points needs to be repeated after the last one. func NewBackgroundRadialGradient(params Params) BackgroundElement { result := new(backgroundRadialGradient) result.init() diff --git a/border.go b/border.go index 23f7cd1..e36c3b8 100644 --- a/border.go +++ b/border.go @@ -261,13 +261,11 @@ func newBorderProperty(value any) BorderProperty { } // NewBorder creates the new BorderProperty. +// // The following properties can be used: -// -// "style" (Style). Determines the line style (int). Valid values: 0 (NoneLine), 1 (SolidLine), 2 (DashedLine), 3 (DottedLine), or 4 (DoubleLine); -// -// "color" (ColorTag). Determines the line color (Color); -// -// "width" (Width). Determines the line thickness (SizeUnit). +// - "style" ([Style]). Determines the line style (int). Valid values: 0 ([NoneLine]), 1 ([SolidLine]), 2 ([DashedLine]), 3 ([DottedLine]), or 4 ([DoubleLine]); +// - "color" ([ColorTag]). Determines the line color (Color); +// - "width" ([Width]). Determines the line thickness (SizeUnit). func NewBorder(params Params) BorderProperty { border := new(borderProperty) border.init() diff --git a/bounds.go b/bounds.go index 8d82570..e1af8cf 100644 --- a/bounds.go +++ b/bounds.go @@ -21,7 +21,7 @@ type boundsPropertyData struct { // NewBoundsProperty creates the new BoundsProperty object. // -// The following SizeUnit properties can be used: "left" (Left), "right" (Right), "top" (Top), and "bottom" (Bottom). +// The following SizeUnit properties can be used: "left" ([Left]), "right" ([Right]), "top" ([Top]), and "bottom" ([Bottom]). func NewBoundsProperty(params Params) BoundsProperty { bounds := new(boundsPropertyData) bounds.init() diff --git a/clipShape.go b/clipShape.go index 7d3beda..03d069b 100644 --- a/clipShape.go +++ b/clipShape.go @@ -5,12 +5,26 @@ import ( "strings" ) +// ClipShape defines the type of a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden. +// +// Possible values: +// - InsetClip - an inset rectangle; +// - CircleClip - a circle using a radius and a position; +// - EllipseClip - an ellipse using two radii and a position; +// - PolygonClip - a polygon by providing one or more pairs of coordinates, each of which represents a vertex of the shape. type ClipShape string const ( - InsetClip ClipShape = "inset" - CircleClip ClipShape = "circle" + // InsetClip is the type of a clipping region: an inset rectangle. + InsetClip ClipShape = "inset" + + // CircleClip is the type of a clipping region: a circle using a radius and a position. + CircleClip ClipShape = "circle" + + // EllipseClip is the type of a clipping region: an ellipse using two radii and a position. EllipseClip ClipShape = "ellipse" + + // PolygonClip is the type of a clipping region: a polygon by providing one or more pairs of coordinates, each of which represents a vertex of the shape. PolygonClip ClipShape = "polygon" ) @@ -46,26 +60,26 @@ type polygonClipData struct { // // The following properties can be used for shapes: // -// InsetClip: -// - "top" (Top) - offset (SizeUnit) from the top border of a View; -// - "right" (Right) - offset (SizeUnit) from the right border of a View; -// - "bottom" (Bottom) - offset (SizeUnit) from the bottom border of a View; -// - "left" (Left) - offset (SizeUnit) from the left border of a View; -// - "radius" (Radius) - corner radius (RadiusProperty). +// [InsetClip]: +// - "top" ([Top]) - offset (SizeUnit) from the top border of a View; +// - "right" ([Right]) - offset (SizeUnit) from the right border of a View; +// - "bottom" ([Bottom]) - offset (SizeUnit) from the bottom border of a View; +// - "left" ([Left]) - offset (SizeUnit) from the left border of a View; +// - "radius" ([Radius]) - corner radius (RadiusProperty). // -// CircleClip: -// - "x" (X) - x-axis position (SizeUnit) of the circle clip center; -// - "y" (Y) - y-axis position (SizeUnit) of the circle clip center; -// - "radius" (Radius) - radius (SizeUnit) of the circle clip center. +// [CircleClip]: +// - "x" ([X]) - x-axis position (SizeUnit) of the circle clip center; +// - "y" ([Y]) - y-axis position (SizeUnit) of the circle clip center; +// - "radius" ([Radius]) - radius (SizeUnit) of the circle clip center. // -// EllipseClip: -// - "x" (X) - x-axis position (SizeUnit) of the ellipse clip center; -// - "y" (Y) - y-axis position (SizeUnit) of the ellipse clip center; -// - "radius-x" (RadiusX) - x-axis radius (SizeUnit) of the ellipse clip center; -// - "radius-y" (RadiusY) - y-axis radius (SizeUnit) of the ellipse clip center. +// [EllipseClip]: +// - "x" ([X]) - x-axis position (SizeUnit) of the ellipse clip center; +// - "y" ([Y]) - y-axis position (SizeUnit) of the ellipse clip center; +// - "radius-x" ([RadiusX]) - x-axis radius (SizeUnit) of the ellipse clip center; +// - "radius-y" ([RadiusY]) - y-axis radius (SizeUnit) of the ellipse clip center. // -// PolygonClip: -// - "points" (Points) - an array ([]SizeUnit) of corner points of the polygon in the following order: x1, y1, x2, y2, …. +// [PolygonClip]: +// - "points" ([Points]) - an array ([]SizeUnit) of corner points of the polygon in the following order: x1, y1, x2, y2, …. // // The function will return nil if no properties are specified, unsupported properties are specified, or at least one property has an invalid value. func NewClipShapeProperty(shape ClipShape, params Params) ClipShapeProperty { diff --git a/columnSeparator.go b/columnSeparator.go index fd3fb2d..ffd7ef3 100644 --- a/columnSeparator.go +++ b/columnSeparator.go @@ -60,9 +60,9 @@ func newColumnSeparatorProperty(value any) ColumnSeparatorProperty { // NewColumnSeparatorProperty creates the new ColumnSeparatorProperty. // // The following properties can be used: -// - "style" (Style) - Determines the line style (type is int). Valid values: 0 (NoneLine), 1 (SolidLine), 2 (DashedLine), 3 (DottedLine), or 4 (DoubleLine); -// - "color" (ColorTag) - Determines the line color (type is [Color]); -// - "width" (Width) - Determines the line thickness (type is [SizeUnit]). +// - "style" ([Style]) - Determines the line style (type is int). Valid values: 0 ([NoneLine]), 1 ([SolidLine]), 2 ([DashedLine]), 3 ([DottedLine]), or 4 ([DoubleLine]); +// - "color" ([ColorTag]) - Determines the line color (type is [Color]); +// - "width" ([Width]) - Determines the line thickness (type is [SizeUnit]). func NewColumnSeparatorProperty(params Params) ColumnSeparatorProperty { separator := new(columnSeparatorProperty) separator.init() @@ -79,7 +79,7 @@ func NewColumnSeparatorProperty(params Params) ColumnSeparatorProperty { // NewColumnSeparator creates the new ColumnSeparatorProperty. // // Arguments: -// - style - determines the line style. Valid values: 0 [NoneLine], 1 [SolidLine], 2 [DashedLine], 3 [DottedLine], or 4 [DoubleLine]; +// - style - determines the line style. Valid values: 0 ([NoneLine]), 1 ([SolidLine]), 2 ([DashedLine]), 3 ([DottedLine]), or 4 ([DoubleLine]); // - color - determines the line color; // - width - determines the line thickness. func NewColumnSeparator(style int, color Color, width SizeUnit) ColumnSeparatorProperty { diff --git a/filter.go b/filter.go index 5be4496..a5fa8d2 100644 --- a/filter.go +++ b/filter.go @@ -144,16 +144,16 @@ type filterData struct { // NewFilterProperty creates the new FilterProperty // // The argument lists the effects to apply. The following effects are possible: -// - "blur" (Blur) - Gaussian blur in pixels (type: float64, value: 0…10000); -// - "brightness" (Brightness) - Brightness change in percents (type: float64, value: 0…10000); -// - "contrast" (Contrast) - Contrast change in percents (type: float64, value: 0…10000); -// - "drop-shadow" (DropShadow) - Adding shadow (type: []ShadowProperty); -// - "grayscale" (Grayscale) - Converting to grayscale in percents (type: float64, value: 0…100%); -// - "hue-rotate" (HueRotate) - Hue rotation (type: AngleUnit); -// - "invert" (Invert) - Invert colors in percents (type: float64, value: 0…100); -// - "opacity" (Opacity) - Changing transparency in percents (type: float64, value: 0…100); -// - "saturate" (Saturate) - Saturation change in percents (type: float64, value: 0…10000); -// - "sepia" (Sepia) - Conversion to sepia in percents (type: float64, value: 0…100). +// - "blur" ([Blur]) - Gaussian blur in pixels (type: float64, value: 0…10000); +// - "brightness" ([Brightness]) - Brightness change in percents (type: float64, value: 0…10000); +// - "contrast" ([Contrast]) - Contrast change in percents (type: float64, value: 0…10000); +// - "drop-shadow" ([DropShadow]) - Adding shadow (type: []ShadowProperty); +// - "grayscale" ([Grayscale]) - Converting to grayscale in percents (type: float64, value: 0…100); +// - "hue-rotate" ([HueRotate]) - Hue rotation (type: AngleUnit); +// - "invert" ([Invert]) - Invert colors in percents (type: float64, value: 0…100); +// - "opacity" ([Opacity]) - Changing transparency in percents (type: float64, value: 0…100); +// - "saturate" ([Saturate]) - Saturation change in percents (type: float64, value: 0…10000); +// - "sepia" ([Sepia]) - Conversion to sepia in percents (type: float64, value: 0…100). func NewFilterProperty(params Params) FilterProperty { if len(params) > 0 { filter := new(filterData) diff --git a/outline.go b/outline.go index 805a948..f5fa00a 100644 --- a/outline.go +++ b/outline.go @@ -22,8 +22,8 @@ type outlinePropertyData struct { // NewOutlineProperty creates the new OutlineProperty. // // The following properties can be used: -// - "color" (ColorTag) - Determines the line color (Color); -// - "width" (Width) - Determines the line thickness (SizeUnit). +// - "color" ([ColorTag]) - Determines the line color (Color); +// - "width" ([Width]) - Determines the line thickness (SizeUnit). func NewOutlineProperty(params Params) OutlineProperty { outline := new(outlinePropertyData) outline.init() diff --git a/shadow.go b/shadow.go index 0f87200..6458a84 100644 --- a/shadow.go +++ b/shadow.go @@ -171,12 +171,12 @@ func NewTextShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | // NewShadowProperty create the new shadow property for a view. // // The following properties can be used: -// - "color" (ColorTag). Determines the color of the shadow (Color); -// - "x-offset" (XOffset). Determines the shadow horizontal offset (SizeUnit); -// - "y-offset" (YOffset). Determines the shadow vertical offset (SizeUnit); -// - "blur" (BlurRadius). Determines the radius of the blur effect (SizeUnit); -// - "spread-radius" (SpreadRadius). Positive values (SizeUnit) will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink; -// - "inset" (Inset). Controls (bool) whether to draw shadow inside the frame or outside. +// - "color" ([ColorTag]) - Determines the color of the shadow (Color); +// - "x-offset" ([XOffset]) - Determines the shadow horizontal offset (SizeUnit); +// - "y-offset" ([YOffset]) - Determines the shadow vertical offset (SizeUnit); +// - "blur" ([BlurRadius]) - Determines the radius of the blur effect (SizeUnit); +// - "spread-radius" ([SpreadRadius]) - Positive values (SizeUnit) will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink; +// - "inset" ([Inset]) - Controls (bool) whether to draw shadow inside the frame or outside. func NewShadowProperty(params Params) ShadowProperty { shadow := new(shadowPropertyData) shadow.init() diff --git a/transform.go b/transform.go index 80e7296..d1b2ac0 100644 --- a/transform.go +++ b/transform.go @@ -287,9 +287,9 @@ type transformPropertyData struct { // // The following properties can be used: // -// Perspective ("perspective"), TranslateX ("translate-x"), TranslateY ("translate-y"), TranslateZ ("translate-z"), -// ScaleX ("scale-x"), ScaleY ("scale-y"), ScaleZ ("scale-z"), Rotate ("rotate"), RotateX ("rotate-x"), -// RotateY ("rotate-y"), RotateZ ("rotate-z"), SkewX ("skew-x"), and SkewY ("skew-y") +// [Perspective] ("perspective"), [TranslateX] ("translate-x"), [TranslateY] ("translate-y"), [TranslateZ] ("translate-z"), +// [ScaleX] ("scale-x"), [ScaleY] ("scale-y"), [ScaleZ] ("scale-z"), [Rotate] ("rotate"), [RotateX] ("rotate-x"), +// [RotateY] ("rotate-y"), [RotateZ] ("rotate-z"), [SkewX] ("skew-x"), and [SkewY] ("skew-y") func NewTransformProperty(params Params) TransformProperty { transform := new(transformPropertyData) transform.init()