npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nativescript-paint

v2.1.0

Published

A plugin for painters!

Downloads

2

Readme

NativeScript 7.0+

Use version 1.1.0 of the plugin

NativeScript Paint

apple android

npm version

NPM

This plugin allows the artist to create paintings in an app using opacity and width settings cross platform. On iOS, an Airbrush as well as a Paintbrush is available. With the Airbrush, you can control Airbrush Flow to make the paint effect change. This plugin would be useful to folks who need a more art-friendly type plugin. Use with the Color Picker plugin to enable color changes.

demo

Installation

tns plugin add nativescript-paint

Requiring the plugin

import { PaintPad } from 'nativescript-paint';

Using the PaintPad

JavaScript

  1. Add the plugin to your xml
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
    xmlns:paint="nativescript-paint">
  1. Create a PaintPad area
<paint:PaintPad canvasColor="#fff" id="paintPad" margin="10" width="280" height="280" drawColor="{{ drawColor }}" drawWidth="{{ drawWidth }}" airBrushFlow="{{ airBrushFlow }}" drawOpacity="{{ drawOpacity }}" />

Angular

  1. Register the plugin in a module
import { registerElement } from 'nativescript-angular/element-registry';
registerElement('PaintPad', () => require('nativescript-paint').PaintPad);
  1. Add it to your markup
<PaintPad
    canvasColor="#fff"
     #PaintPad			
     [drawColor]="drawColor"
     [drawWidth]="drawWidth"
     [airBrushFlow]="airBrushFlow"
     [drawOpacity]="drawOpacity"
></PaintPad>
  1. Reference the PaintPad by id to manipulate it
@ViewChild('PaintPad') PaintPad: ElementRef;
this.myPaintPad = this.PaintPad.nativeElement;

Vue

  1. In main.js, register the element:
Vue.registerElement('PaintPad', () => require('nativescript-paint').PaintPad);
  1. Use it in your app:
<PaintPad
    canvasColor="#fff"
    ref="paintPad"
    :drawColor="drawColor"
    :drawWidth="drawWidth"
    :airBrushFlow="airBrushFlow"
    :drawOpacity="drawOpacity"
/>
  1. Reference the PaintPad by ref to manipulate it
selectAirBrush() {
    this.$refs.paintPad.nativeView.setToolType(1);
}

Demos

In /src, you can use npm scripts to run demos in vanilla JS, Angular and Vue. Run:

npm run demo.ios or npm run demo-ng.ios or npm run demo-vue.ios. Reset the demos similarly, running npm run demo(-ng or -vue).reset.

Usage

Describe any usage specifics for your plugin. Give examples for Android, iOS, Angular if needed. See nativescript-drop-down for example. javascript Usage code snippets here)

| iOS | Android | | ------------------------------------------------------- | ---------------------------------------------------------- | | DAScratchPad | FreeDrawView |

API

Describe your plugin methods and properties here. See nativescript-feedback for example.

| Property | Default | Description | | --------------- | ------------------------ | ---------------------------------------------------------- | | drawWidth | 5 | width of the brush | | drawColor | #3489db | a hex code for color | | drawOpacity | 1 (iOS) or 255 (Android) | on iOS, set this to between 0-1. On Android, between 0-255 | | airBrushFlow | 0.7 | iOS only - how heavy the Airbrush paints | | getPainting | | save an image of your painting | | clearPainting | | clear the paint area | | setToolType | 0 | iOS only - set 0 for Paintbrush, 1 for Airbrush |

Credits

With gratitude to Brad Martin, author of the first drawing plugin NativeScript-Drawingpad, on which this plugin is heavily based, and to the help of Nathan Walker and Osei Fortune. ❤️

License

Apache License Version 2.0, January 2004