FLUTTER ECOSYSTEM

mattrltrent/colorify

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

colorify 專案封面
Stars
1
Forks
0
最近推送(UTC)
2025年1月14日
專案狀態
未封存
Matthew Trent GitHub avatar
GITHUB User

Matthew Trent ↗

SWE @ Sorce (YC F25) | MS CS @ Columbia | Prev. @ Probe, Magi, Confesi (Founder) | Honors BS CS w/ Distinction

Sorce (YC F25)San Francisco, CA
語言C++CMakeDartSwiftCHTMLKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項
  • flutter{"sdk":"flutter"}
  • crypto^3.0.6
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^4.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 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

https://raw.githubusercontent.com/mattrltrent/random_assets/refs/heads/main/colorify_ex.gif
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);
}