Loading...
Loading...
Creates custom BrushFamily definitions for an Android app using Jetpack Ink (androidx.ink 1.1.0-alpha03 and higher). Use this skill when configuring custom BrushTip shapes, adding pressure, tilt, speed, or noise sensitivity using BrushBehavior node graphs, creating multi-coat layered brushes, applying tiling or particle stamping textures, configuring SlidingWindowModel input smoothing, or serializing brushes. Delivers complete Kotlin BrushFamily, BrushCoat, BrushTip, BrushPaint, and BrushBehavior implementations. Don't use for View-based (XML) inking, Compose drawing surface setup, or stock brush selection. For Compose drawing surface setup, InProgressStrokes wet and dry rendering, eraser, or persistence, suggest the ink-app-builder skill.
npx skill4agent add android/skills ink-custom-brush-builderBrushFamilyBrushFamily
├── InputModel (BrushFamily.InputModel.SlidingWindowModel or PASSTHROUGH_MODEL)
└── BrushCoat[] (one or more rendering layers)
├── BrushTip (shape: scaleX, scaleY, cornerRounding, rotationDegrees, slantDegrees, pinch)
│ └── BrushBehavior[] (dynamic response to stylus or touch input)
│ └── Tree: TargetNode(input = [Operators](input = SourceNode))
└── BrushPaint (visual appearance)
├── SelfOverlap (ANY, ACCUMULATE, or DISCARD)
├── TextureLayer[] (BrushPaint.TilingTexture or BrushPaint.StampingTexture)
└── BrushPaint.ColorFunction[] (OpacityMultiplier or ReplaceColor)BrushBrushFamilyColorsizeepsilonval brush = Brush.createWithComposeColor(
family = myCustomFamily,
color = Color.Black,
size = 10f,
epsilon = 0.1f,
)Version and experimental API requirements :
- Requires
androidx.inkand higher : In1.1.0-alpha03(Stable) and1.0.0-1.1.0-alpha01,alpha02,BrushFamily(...),BrushCoat,BrushTip,BrushPaint, andBrushBehaviornodes wereandroidx.ink.brush.behavior.*(in@RestrictTo(LIBRARY_GROUP)stable, custom brushes can only be loaded from binary proto streams using1.0.0). Starting inBrushFamily.decodeand higher , programmatic custom brush constructors graduated to public API (1.1.0-alpha03,BrushPaint.TilingTexture,BrushPaint.StampingTexture,BrushPaint.ColorFunction, and all behavior nodes).BrushFamily.InputModel.SlidingWindowModel- No
required in@OptInand higher : All public custom brush classes and1.1.0-alpha03ink-storageserialization APIs (BrushFamilyandBrushFamily.encode,decode,AndroidBrushFamilySerialization) are unannotated inBrushFamilyDecodeCallbackand higher (1.1.0-alpha03isExperimentalInkCustomBrushApiin@RestrictTo(LIBRARY_GROUP)and higher, and is only required on1.1.0-alpha05serialization inBrushFamilystable).1.0.0
androidx.ink:ink-brushandroidx.ink:ink-brush-composeandroidx.ink:ink-storageandroidx.ink:ink-nativeloader1.1.0-alpha03gradle/libs.versions.tomlapp/build.gradle.ktsBrushFamilyBrushCoatBrushTipscaleXscaleYcornerRoundingrotationDegreesslantDegreespinchBrushPaintSelfOverlapColorFunctionBrushFamily.InputModel.SlidingWindowModelBrush1.0.0BrushBehaviorSourceNodeDampingNodeNoiseNodeResponseNodeTargetNodePolarTargetNodeBrushPaint.TilingTextureBrushPaint.StampingTextureTextureBitmapStoreBrushFamilyBrushFamily.encodedecodeAndroidBrushFamilySerializationBrushFamilyDecodeCallbackapp/src/main/res/drawable-nodpi/pencil_grain.pngTextureBitmapStoreInProgressStrokesink-app-builderink.proto.*BrushFamilyBrushCoatBrushTipBrushPaintBrushBehaviorandroidx.ink.brush.*BrushBehaviorSourceNode.Source.NORMALIZED_PRESSURETILT_IN_RADIANSTargetNode.Target.SIZE_MULTIPLIERWIDTH_MULTIPLIERCanvasBitmapShaderBrushPaint.TilingTextureBrushPaint.StampingTextureTextureBitmapStoreBlendMode.SRC_OVERTextureLayerBlendMode.MODULATEDST_INDST_OUTSRC_ATOPSRC_INOPACITY_MULTIPLIERBrushFamilyParcelableBrushFamily.encodeBrushFamily.decodeAndroidBrushFamilySerializationandroidx.ink.storagequadTocubicToBrushFamily.InputModel.SlidingWindowModelDampingNodeRandom.nextFloatNoiseNodeBrushBehavior