Utilização

Share stroke styling between shapes.

tsx
// 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>;

Declaração do tipo

ts
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;
}

Membros 14

NomeTipoObrigatórioDescrição
fillstringNãoA hex color, or none; black by default.
fillRuleFillRuleNão—
strokestringNãoA hex color, or none, the default.
strokeWidthnumberNãoIn user units; 1 by default.
strokeLinecapStrokeLinecapNão—
strokeLinejoinStrokeLinejoinNão—
strokeMiterlimitnumberNão—
strokeDasharrayreadonly number[]NãoDash and gap lengths in user units, repeated.
strokeDashoffsetnumberNão—
opacitynumberNãoMultiplies with its Groups' opacity.
translateXnumberNãoIn user units, then rotate in degrees and scale, about the origin.
translateYnumberNão—
scalenumberNão—
rotatenumberNão—
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.