パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.4

pigment

便利でシンプルなFlutterカラーハンドラー。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.8万
いいね数
20
Pub ポイント
110

パッケージをインストール

flutter pub add pigment

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Pigmentは、アプリケーション内の色の処理を簡素化するために設計された軽量で直感的なFlutterパッケージです。さまざまな色モデルやフォーマットをサポートし、色の作成・操作・変換を行うための明確なAPIを提供します。大きなライブラリの複雑さなく、色のロジックを簡単に管理したい開発者に最適です。Pigmentはモバイル、ウェブ、デスクトップを含むすべての主要プラットフォームにシームレスに統合され、クロスプラットフォームプロジェクトに非常に柔軟に対応できます。

用途

  • UIデザインにおける色の操作
  • カラーフォーマット間の変換
  • ダイナミックテーマ生成
  • カスタムカラーのパレット
  • アプリ内の色論理を簡素化する
  • 応答性のある色の調整

主な機能

  • カラーモードの作成と解析が簡単
  • 複数のカラーモデル(HSL、HSVなど)のサポート
  • 組み込みの色ブレンドと不透明度処理
  • クロスプラットフォーム互換性
  • 最小限のボイラープレート
  • 拡張可能な色操作

適している対象

  • シンプルなカラーツールが必要なFlutter開発者
  • 動的またはテーマベースのカラースキームを持つアプリ
  • デザイナーと開発者がUIカラーシステムについて協力している
  • 一貫したカラーマネジメントを必要とするプロジェクト
  • プロトタイピングと迅速なUI開発

注意事項

  • 高度な色彩理論アプリケーションには適していません
  • 基本的な色操作に限定
  • 組み込みのカラーピッカーUIがありません
  • 単純なカラーハンドリングのニーズに最適
  • 機能豊富なカラーピッカーを置き換えるものではありません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pigment

pub package

A simple but useful plugin for use colors with Flutter

Features

  • You can use string colors (like #01E19F) direct in flutter
  • Pigment extends to Color dar:ui class, then you can use all methods of Color class
  • Pigment 1.0.1 can parse 'rgb()' (e.g. 'rgb(29, 123, 10)').
  • Added CSS colors with default name, you can access from this with CSSColor.* (e.g. Pigment.fromCSSColor(CSSColor.lightsalmon)) or directly with Pigment.fromString('lightsalmon').

Installation

First, add pigment as a dependency in your pubspec.yaml file.

Use

It's very simple, pigment add a new useful method to Color class, this method is Pigment.fromString(). Also like Color, you can use new Pigment().

Pigment.fromString()
new Pigment()

Example

Here is a small example of the classic and simple pigment use.

import 'package:flutter/material.dart';
import 'package:pigment/pigment.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Pigment Demo',
      theme: new ThemeData(
        primarySwatch: Colors.red,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text('Pigment App'),
        ),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("#FE5567"))),
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("#01E19F"))),
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("#4A48D2"))),
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("rgb(253, 196, 86)"))),
            ],
          ),
        ));
  }
}

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト