패키지, 저장소 및 앱 카테고리 검색

flutter_randomcolor 표지
패키지 상세v1.0.18

flutter_randomcolor

매력적인 랜덤 색상을 생성하기 위한 플러터 패키지입니다. 데이터 시각화, 생성적 예술 등 다양한 용도로 사용할 수 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
3.8천
좋아요
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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트