ShapePaint
How a shape is painted, as SVG's presentation attributes. A Group's is its shapes'.
Utilisation
Share stroke styling between shapes.
// Share stroke styling between shapes.
import { Circle, Drawing, Path, type ShapePaint } from 'kuito';
// The app's icon strokes, shared by every shape that draws one.
const iconStroke: ShapePaint = {
fill: 'none',
stroke: '#1c1c1e',
strokeWidth: 2,
strokeLinecap: 'round',
strokeLinejoin: 'round',
};
<Drawing label="Search" viewBox={[0, 0, 24, 24]} width={24} height={24}>
<Circle cx={11} cy={11} r={7} {...iconStroke} />
<Path d="M16 16l5 5" {...iconStroke} />
</Drawing>;Déclaration du type
export interface ShapePaint {
/** A hex color, or `none`; black by default. */
fill?: string;
fillRule?: FillRule;
/** A hex color, or `none`, the default. */
stroke?: string;
/** In user units; 1 by default. */
strokeWidth?: number;
strokeLinecap?: StrokeLinecap;
strokeLinejoin?: StrokeLinejoin;
strokeMiterlimit?: number;
/** Dash and gap lengths in user units, repeated. */
strokeDasharray?: readonly number[];
strokeDashoffset?: number;
/** Multiplies with its Groups' opacity. */
opacity?: number;
/** In user units, then `rotate` in degrees and `scale`, about the origin. */
translateX?: number;
translateY?: number;
scale?: number;
rotate?: number;
}Membres 14
| Nom | Type | Requis | Description |
|---|---|---|---|
fill | string | Non | A hex color, or none; black by default. |
fillRule | FillRule | Non | — |
stroke | string | Non | A hex color, or none, the default. |
strokeWidth | number | Non | In user units; 1 by default. |
strokeLinecap | StrokeLinecap | Non | — |
strokeLinejoin | StrokeLinejoin | Non | — |
strokeMiterlimit | number | Non | — |
strokeDasharray | readonly number[] | Non | Dash and gap lengths in user units, repeated. |
strokeDashoffset | number | Non | — |
opacity | number | Non | Multiplies with its Groups' opacity. |
translateX | number | Non | In user units, then rotate in degrees and scale, about the origin. |
translateY | number | Non | — |
scale | number | Non | — |
rotate | number | Non | — |
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.