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

flutter_randomcolor のカバー
パッケージ詳細v1.0.18

flutter_randomcolor

魅力的なランダムカラーを生成するためのFlutterパッケージです。データ可視化やジェネレーティブアートなどに活用できます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
3840
いいね数
33
Pub ポイント
150

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

flutter pub add flutter_randomcolor

パッケージ概要

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

flutter_randomcolor は、データビジュアライゼーション、UIデザイン、ジェネレーティブアートに適した視覚的に魅力的なランダムカラーを生成するFlutterパッケージです。退屈な色や非常に似たようなトーンを避けることで、色の多様性と美的調和を保証します。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームアプリケーションに最適です。シンプルなAPIにより、開発者はアプリ内に動的なカラーセットを簡単に統合できます。チャート、バッジ、ユーザー生成コンテンツなどに異なる色を割り当てる場合に特に役立ちます。

用途

  • データ可視化
  • UI要素の色付け
  • ジェネラティブアート
  • ユーザー プロフィール イコン
  • ダイナミックテーマ生成

主な機能

  • 魅力的な色の生成
  • 退屈な色や似た色を避ける
  • クロスプラットフォーム対応
  • シンプルなAPI統合
  • カラーハーモニーの最適化

適している対象

  • ビジュアルダッシュボードを作成する開発者
  • 動的なカラースキームが必要なデザイナー
  • ユーザーが生成したコンテンツを含むアプリ
  • 教育的または創造的なツール
  • インタラクティブプロトタイプ

注意事項

  • 厳格なブランドカラー要件に合わない可能性があります
  • カラーパレットのカスタマイズオプションが限られている
  • アクセシビリティを重視した色の選択には適していません
  • ランダム性がUXを向上させる場所で最適に使用
  • 色のコントラストを手動で処理する必要があります

元の README

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

RandomColor for Dart & Flutter

CircleCI Github Code Size Github License Pub version

Generate visually appealing random colors with ease in your Dart and Flutter projects.

Demo

Interactive Demo

Table of Contents

Features

  • Generate random colors with fine-tuned control
  • Specify color types, luminosity, and output formats
  • Direct integration with Flutter's Color class
  • Highly customizable with easy-to-use API
  • Consistent results across platforms

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_randomcolor: ^1.0.16

Then run:

$ flutter pub get

Quick Start

import 'package:flutter_randomcolor/flutter_randomcolor.dart';

// Generate a random color
var color = RandomColor.getColor(Options());

// Generate a Flutter Color object
Color flutterColor = RandomColor.getColorObject(Options());

Usage Guide

Basic Usage

Generate a random color with default options:

var color = RandomColor.getColor(Options());
Flutter Integration

Get a Color object for direct use in Flutter widgets:

Color widgetColor = RandomColor.getColorObject(Options(
  colorType: ColorType.blue,
  luminosity: Luminosity.light,
));

// Use in a widget
Container(
  color: widgetColor,
  child: Text('Colored Container'),
)
Advanced Options

Fine-tune your color generation:

var customColor = RandomColor.getColor(Options(
  colorType: [ColorType.red, ColorType.blue],
  luminosity: Luminosity.dark,
  format: Format.rgba,
  alpha: 0.8,
));

API Reference

RandomColor.getColor(Options options)

Returns a color based on the specified options.

RandomColor.getColorObject(Options options)

Returns a Flutter Color object based on the specified options.

Options class
  • colorType: ColorType or List<ColorType>
  • luminosity: Luminosity
  • format: Format
  • alpha: double (0.0 to 1.0)
  • count: int
ColorType

random, monochrome, red, orange, yellow, green, blue, purple, pink

Luminosity

random, dark, light, bright

Format

rgba, rgb, rgbArray, hsla, hex, hsl, hsva, hsvArray, hslArray

Examples

// Bright green color in hex format
var brightGreen = RandomColor.getColor(Options(
  colorType: ColorType.green,
  luminosity: Luminosity.bright,
  format: Format.hex
));

// Array of 5 pastel colors
var pastelColors = RandomColor.getColor(Options(
  luminosity: Luminosity.light,
  count: 5
));

// Dark red or blue with 50% opacity
var transparentDark = RandomColor.getColor(Options(
  colorType: [ColorType.red, ColorType.blue],
  luminosity: Luminosity.dark,
  format: Format.rgba,
  alpha: 0.5
));


// Flutter Color with seed options to return the same color
var seedColor = RandomColor.getColorObject(Options(
  colorType: ColorType.red,
  luminosity: Luminosity.dark,
  format: Format.hex,
  seed: 1234
));

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements


Available in Other Languages

カテゴリー

ソースリポジトリ

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