colorify 0.0.2 copy "colorify: ^0.0.2" to clipboard
colorify: ^0.0.2 copied to clipboard

A simple Flutter package to generate deterministic, random colors from a given dynamic seed.

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'.
}
copied to clipboard

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);
}
copied to clipboard
1
likes
160
points
38
downloads

Publisher

verified publishermatthewtrent.me

Weekly Downloads

2024.09.05 - 2025.03.20

A simple Flutter package to generate deterministic, random colors from a given dynamic seed.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #color #random #deterministic #color-generation

Documentation

API reference

License

MIT (license)

Dependencies

crypto, flutter

More

Packages that depend on colorify