v0.0.2
colorify
一個簡單的 Flutter 套件,可根據給定的動態種子產生決定性的隨機顏色。
1喜歡 46近 30 天下載160Pub 分數
AndroidiOSWebmacOSWindowsLinux
🎨 一個簡單的 Flutter 套件,可根據給定的動態種子產生決定性的隨機顏色。
以下為英文專案原文快照,最新內容請造訪 GitHub。
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.
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'.
}
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);
}
依賴清單 4 項
{"sdk":"flutter"}^3.0.6{"sdk":"flutter"}^4.0.0先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗