搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.2

colorify

一個簡單的 Flutter 套件,可根據給定的動態種子產生決定性的隨機顏色。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
46
喜歡數
1
Pub 分數
160

安裝套件

flutter pub add colorify

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Colorify 是一個輕量級的 Flutter 套件,根據動態種子輸入產生確定性的隨機顏色。這確保了在使用相同種子時多次呼叫的顏色輸出保持一致,非常適合需要可重現配色方案的應用程式。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。該套件易於整合,適用於視覺化、UI 元件或資料標記等情境,其中需要獨特但可預測的顏色。

適用情境

  • 為資料視覺化產生一致的顏色
  • 為使用者資料分配唯一顏色
  • 使用可重複使用的調色板創建主題化UI元素
  • 在清單或圖表中對項目進行顏色編碼
  • 使用基於種子的隨機性設計動態主題

主要特色

  • 從種子生成確定性顏色
  • 支援動態種子類型
  • 跨平台相容性
  • 簡單的 API,設定簡單
  • 無外部依賴

適合對象

  • 需要可重現顏色方案的開發者
  • UI/UX 設計師與動態主題協作
  • 需要唯一且一致著色的應用程式
  • 具有資料視覺化需求的專案
  • 原型設計互動介面

使用建議

  • 種子必須保持一致,以獲得相同的顏色輸出
  • 不適合用於加密或安全敏感的顏色生成
  • 僅限顏色生成——無法進行高級調色板操作
  • 性能影響可忽略不計,但取決於使用頻率
  • 不支援顏色混合或漸變

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Colorify

An extremely simple Flutter package that deterministically converts arbitrary dynamic input into a Color. Published mainly for personal use to avoid reinventing the wheel in my projects.

Usage

Basic Example
import 'package:colorify/colorify.dart' as c;
import 'package:flutter/material.dart';

void main() {
  final input = 'example-seed';
  final color = c.colorify(input);
  print(color); // Outputs a Color object deterministically derived from 'example-seed'.
}
Customizing Color Type

You can specify the type of colors generated by using the ColorType enum:

  • ColorType.all: Generates colors from the full spectrum.
  • ColorType.brights: Generates bright and vibrant colors.

Example:

import 'package:colorify/colorify.dart' as c;
import 'package:flutter/material.dart';

void main() {
  final input = 'example-seed';

  // Generate a color from the full spectrum
  final allColors = c.colorify(input, colorType: c.ColorType.all);

  // Generate a bright color
  final brightColor = c.colorify(input, colorType: c.ColorType.brights);
}

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。