ink-custom-brush-builder
What it does
This skill guides building custom brush styles for an Android drawing app with Jetpack Ink. It covers brush shapes, responses to input, textures and smoothing. It is for Android developers who want brushes beyond the standard ones.
When to use it
- βWhen you want a brush whose thickness changes with stylus pressure.
- βWhen you need a textured or layered brush for a drawing app.
- βWhen you want to save a custom brush so the app can load it later.
Skill link
https://github.com/android/skills/blob/main/jetpack-compose/ink/ink-custom-brush-builder/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCreate a custom textured brush for my Android drawing app that responds to pressure and tilt.β
5 new skills a week. 1 minute to read.
How it works
The skill builds a brush family from its shape, its responses to input, and its paint textures. It then turns that brush into one the app can use for drawing.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Custom brushes in the Android Ink API are built around the BrushFamily
hierarchy:
BrushFamily
βββ 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)
Create a Brush by combining a custom BrushFamily with a Compose Color,
size, and epsilon:
val brush = Brush.createWithComposeColor(
family = myCustomFamily,
color = Color.Black,
size = 10f,
epsilon = 0.1f,
)
<br />
Version and experimental API requirements :
- Requires
androidx.ink1.1.0-alpha03and higher : In1.0.0(Stable) and1.1.0-alpha01-alpha02,BrushFamily(...),BrushCoat,BrushTip,BrushPaint,BrushBehavior, andandroidx.ink.brush.behavior.*nodes were@RestrictTo(LIBRARY_GROUP)(in1.0.0stable, custom brushes can only be loaded from binary proto streams usingBrushFamily.decode). Starting in1.1.0-alpha03and higher , programmatic custom brush constructors graduated to public API (BrushPaint.TilingTexture,BrushPaint.StampingTexture,BrushPaint.ColorFunction,BrushFamily.InputModel.SlidingWindowModel, and all behavior nodes).- No
@OptInrequired in1.1.0-alpha03and higher : All public custom brush classes andink-storageBrushFamilyserialization APIs (BrushFamily.encodeanddecode,AndroidBrushFamilySerialization,BrushFamilyDecodeCallback) are unannotated in1.1.0-alpha03and higher (ExperimentalInkCustomBrushApiis@RestrictTo(LIBRARY_GROUP)in1.1.0-alpha05and higher, and is only required onBrushFamilyserialization in1.0.0stable).
Workflow and task routing
Follow these conditional instructions based on the requested custom brush task:
- Step 1 (Dependencies) : When setting up an Android project for programmatic custom brushes, ask user permission before editing build files and verify that
androidx.ink:ink-brush,androidx.ink:ink-brush-compose,androidx.ink:ink-storage, andandroidx.ink:ink-nativeloaderuse version1.1.0-alpha03or higher ingradle/libs.versions.tomlandapp/build.gradle.kts. - Step 2 (Hierarchy, tip shape, paint, and input smoothing) : When defining
BrushFamilyand multi-coatBrushCoatlayers, configuringBrushTipgeometry (scaleX,scaleY,cornerRounding,rotationDegrees,slantDegrees,pinch), settingBrushPaintproperties (SelfOverlap,ColorFunction), or smoothing stroke input withBrushFamily.InputModel.SlidingWindowModel, you MUST follow brush-structure.md. For baselineBrushcreation or1.0.0resource loading, review Brush APIs. - Step 3 (Dynamic stylus and touch behaviors) : When making a brush respond dynamically to stylus pressure, tilt, speed, direction, or procedural noise using
BrushBehaviornode trees (SourceNode,DampingNode,NoiseNode,ResponseNode,TargetNode,PolarTargetNode), you MUST follow brush-behaviors.md. - Step 4 (Textures and serialization) : When adding
BrushPaint.TilingTextureorBrushPaint.StampingTexturelayers, implementingTextureBitmapStore, or encoding and decoding customBrushFamilydefinitions (BrushFamily.encodeanddecode,AndroidBrushFamilySerialization,BrushFamilyDecodeCallback), you MUST follow textures-and-serialization.md. Inform the user which texture image files (such asapp/src/main/res/drawable-nodpi/pencil_grain.png) to add to their project and register inTextureBitmapStore. - Step 5 (Complete brush recipes) : When building a complete pressure pen, calligraphy nib, shading pencil, watercolor wash, or multi-coat shadow brush from scratch, start from the copy-ready implementations in examples.md.
- **Compose
FAQ
Which Jetpack Ink version does it need?
Custom brushes need androidx.ink version 1.1.0-alpha03 or newer, because the stable 1.0.0 release restricts them.
Which inputs can a brush respond to?
It can respond to stylus pressure, tilt, speed and noise, depending on the behaviors you set.
Can a custom brush be saved?
Yes. The skill covers saving a brush family so it can be stored and loaded again.
Details
Original description by the author
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 br
repo: android/skills
Popularity
- GitHub stars
- 10k
- Ranking position
- #11920
- License
- Apache-2.0
- Updated
- 10/29/2026
Comments
- β¦
More skills from this repository
agp-9-upgrade
10kHelps your agent upgrade an Android app to Android Gradle Plugin 9 and work through its breaking changes. Not for multiplatform projects.
camerax
10kHelps your agent build Android camera features with CameraX, including video recording, hardware controls, ML Kit and Media3 effects.
android-for-cars-parked-apps
10kHelps your agent adapt an Android video, game or browser app to run as a parked app on Android Auto and Android Automotive.
appfunctions
10kHelps your agent find key workflows in an Android app and expose them as AppFunctions that AI agents and voice commands can run.
Similar skills
android-clean-architecture
280kMakes your agent organize Android projects efficiently. It structures the code to make maintenance and new feature development easier.
compose-multiplatform-patterns
280kHelps your agent use Compose Multiplatform and Jetpack Compose patterns in KMP projects, covering state, navigation, theming, and performance.
dart-flutter-patterns
280kMakes your agent write code for Dart and Flutter apps. It uses modern patterns to create robust and manageable apps.