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);
}