open-index/open-npm huggingface dataset:
npm package: @nclslbrn/artistry-swatch
Description: A package to get random palette from iconic painting of art history
Author: Nicolas Lebrun
Latest version: 0.0.7

# Artistry-swatch

A package to get random palette from iconic painting of art history

## Installation

```
npm install @nclslbrn/artistry-swatch
```

- or -
```
yarn add @nclslbrn/artistry-swatch
```


## How use it

```
import { getPalette } from '@nclslbrn/artistry-swatch'

// No filter
const palette = getPalette()

// Specify a random value ($fx.rand() for exemple)
const palette = getPalette({ rand: 0.6 })

// Specify temperature of palette
const palette = getPalette({ temp: 'warm' })

// Specify if you want an inverted palette (dark background with bright colors)
const palette = getPalette({ theme: 'dark' })

// Specify an artist
const palette = getPalette({ artist: "Albrecht Dürer"})
```
| Parameters | Value                                       | Default       |
|------------|---------------------------------------------|---------------|
| rand       | float between 0 & 1                         | Math.random() |
| temp       | string (cold, warm or any)                  | any           |
| theme      | string (bright, dark or any)                | any           |
| artist     | string (artist firstname + lastname or any) | any           |


## Returned palette object

The function getPalette return a palette or false if nothing match your criteria.

Every color is defined by an hexadecimal value (# include) without alpha.

Each palette has a `background` and a `stroke` (single color) and `colors` with multiple colors.

There is also some informations about the origin of the palette in `meta` (title, artist, year and techniques)

The getPalette will return only one palette, here is an exemple.

```
{
  background: "#1C2424",
  colors: ["#3D55A8", "#3FA622", "#F6F7F1", "#463D33"],
  stroke: "#6A6157",
  temp : "cold",
  theme: "dark",
  meta: {
    title: "Stained glass composition, Woman",
    artist: "Theo van Doesburg",
    year: "1917",
    techniques: "Glass",
  }
}
```
npm package: @nclsm/jsbridge
Description: Bridging Android and webview
Author: nclsm
Latest version: 1.0.1

# @nclsm/jsbridge

## 开始

```
npm install --save @nclsm/jsbridge
```

## 使用

```javascript
import jsbridge from "@nclsm/jsbridge";

// js调APP方法 （参数分别为:app提供的方法名  传给app的数据  回调）
jsbridge.callHandler(name, data, callback)

// 注册APP调js方法 （参数分别为:js提供的方法名  回调）
jsbridge.registerHandler(name, callback)
```
npm package: @nclsndr/design-tokens-utils
Description: Internal tooling for @nclsndr/*-design-tokens-* packages
Author: Nico Andre
Latest version: 0.0.1

# Design Tokens Utils

> [!IMPORTANT]
> This package is not intended to be used in external projects.
> For usage have a look to @nclsndr/design-tokens-library

This package gathers utilities for:
- W3C design tokens manipulation
- JSON manipulation
- Error carrier for validation
npm package: @nclsndr/npm-export-playground
Description: DO NOT USE - Experimental package to test ESM resolution
Author: nclsndr
Latest version: 1.0.4

# @nclsndr/npm-export-playground

## Usage

This package is a playground for testing the `exports` field in `package.json`.

## Installation

```bash
npm install @nclsndr/npm-export-playground
```
npm package: @nclsndr/w3c-design-tokens-parser
Description: a TypeScript implementation of the parser for the W3C Design Tokens Format Module specification
Author: Nico Andre
Latest version: 0.2.0

# W3C Design Tokens Parser

<img src="https://github.com/nclsndr/design-tokens-tools/blob/main/packages/w3c-design-tokens-parser/docs/_assets/tokens-parser.jpg?raw=true" width="400" />

This package provides a TypeScript implementation of the parser for the [W3C Design Tokens Format Module](https://tr.designtokens.org/format) specification. It returns a structured object containing the parsed design tokens, groups and the potential errors found during the parsing and validation processes.

## Installation

### Using npm

```bash
$ npm install @nclsndr/w3c-design-tokens-parser
```

### Using yarn

```bash
$ yarn add @nclsndr/w3c-design-tokens-parser
```

### Using pnpm

```bash
$ pnpm add @nclsndr/w3c-design-tokens-parser
```

## Usage


### Parse a JSON token tree

The main API of the package is the `parseJSONTokenTree` function. It takes a JSON object representing the design tokens tree and returns an [Either](https://effect-ts.github.io/effect/effect/Either.ts.html) (from [Effect](https://effect.website/)) type wrapping either, an object literal containing the parsed tokens, groups and their validation errors; either, a parse error encountered with the input.

```typescript
import { Either } from 'effect'
import { parseJSONTokenTree } from '@nclsndr/w3c-design-tokens-parser';

const designTokens = {
  color: {
    $type: 'color',
    primary: {
      $value: '#ff0000',
    },
  }
}

const parsedJSONTokenTree = parseJSONTokenTree(designTokens);

const matched = Either.match(result, {
  onRight: (r) => {
    const errors = [...r.tokenErrors, ...r.groupErrors];
    if (errors.length) {
      throw new Error(errors.map((e) => e.message).join('\n'));
    }
    return {
      tokens: r.analyzedTokens,
      groups: r.analyzedGroups,
    }
  },
  onLeft: (err) => {
    throw new Error(err.map(e => e.message).join('\n'));
  },
})
```

## API

### `parseJSONTokenTree`

```typescript
type ParsedJSONTokenTree = Either.Either<{
    tokenTree: JSONTypes.Object;
    analyzedTokens: Array<AnalyzedToken>;
    analyzedGroups: Array<AnalyzedGroup>;
    tokenErrors: Array<ValidationError>;
    groupErrors: Array<ValidationError>;
}, ValidationError[]>;
declare function parseJSONTokenTree(input: unknown): ParsedJSONTokenTree;
```