Package io.getstream.sketchbook

Types

Link copied to clipboard
data class PaintColorPaletteTheme(shape: Shape, itemSize: Dp, selectedItemSize: Dp, borderColor: Color, borderWidth: Dp)

A theme that has a collection parameters to customize PaintColorPalette.

Link copied to clipboard
class SketchbookController

SketchbookController interacts with Sketchbook and it allows you to control the canvas and all of the components with it.

Functions

Link copied to clipboard
@Composable
fun ColorPickerDialog(controller: SketchbookController? = null, expanded: MutableState<Boolean>, backgroundColor: Color = Color.White, selectText: String = "Select", initialColor: Color? = null, onColorSelected: (Color) -> Unit? = null)

A color picker dialog to get a desired color from users.

Link copied to clipboard
@Composable
fun ColorPickerPaletteIcon(modifier: Modifier, controller: SketchbookController, bitmap: ImageBitmap)

Basic color palette icon to show up color picker dialog and apply selected colors to SketchbookController. ColorPickerPaletteItem also can be used to header and footer for the PaintColorPalette.

Link copied to clipboard
@Composable
fun PaintColorPalette(modifier: Modifier = Modifier, controller: SketchbookController, colorList: List<Color> = defaultColorList(), theme: PaintColorPaletteTheme = PaintColorPaletteTheme(), initialSelectedIndex: Int = -1, onColorSelected: (Int, Color) -> Unit? = null, header: @Composable () -> Unit? = null, content: @Composable (Int, Color) -> Unit? = null, footer: @Composable () -> Unit? = null)

PaintColorPalette provides a list of color palette. With SketchbookController it will take and apply the selected color to the Sketchbook automatically.

Link copied to clipboard
@Composable
fun rememberSketchbookController(): SketchbookController

Creates and remembers a SketchbookController on the current composer.

Link copied to clipboard
@Composable
fun Sketchbook(modifier: Modifier, controller: SketchbookController, backgroundColor: Color = Color.Transparent, imageBitmap: ImageBitmap? = null, onEventListener: (x: Float, y: Float) -> Unit? = null, onRevisedListener: (canUndo: Boolean, canRedo: Boolean) -> Unit? = null)

Sketchbook is a canvas implementation to draw paths with custom properties.