v1.0.5random_color
색조, 채도 및 밝기에서 시각적으로 매력적인 랜덤 색상을 생성합니다. 정확한 색상 사양을 선택할 수 있습니다.
Flutter용 랜덤 색상 생성기
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Pub link: https://pub.dartlang.org/packages/random_color
This library will generate random colors that are visually pleasing and can be customized by passing custom hue, saturation and brightness range. This allows it to generate just specific color with slight differences.
random color function can be called with parameters colorHue, colorSaturation and colorBrightness allowing for customization of colors the generator will pass.
import 'package:random_color/random_color.dart';
RandomColor _randomColor = RandomColor();
Color _color = _randomColor.randomColor();
You can get color name from hex string (without # and alpha hex values) or from Color object
Color _color = Color('FF0000'.toStringRadix(16));
MyColor _myColor = getColorNameFromColor(_color);
// Prints: 'Red'
print(_myColor.getName);
Random color can generate just specific color type, as long hue, saturation and brightness are not too limiting this will still give rich result
import 'package:random_color/random_color.dart';
RandomColor _randomColor = RandomColor();
Color _color = _randomColor.randomColor(colorHue: ColorHue.red);
You can combine multiple hue ranges to choose from
import 'package:random_color/random_color.dart';
RandomColor _randomColor = RandomColor();
Color _color = _randomColor.randomColor(
colorHue: ColorHue.multiple([ColorHue.red, ColorHue.blue])
);
import 'package:random_color/random_color.dart';
RandomColor _randomColor = RandomColor();
Color _color = _randomColor.randomColor(
colorSaturation: ColorSaturation.highSaturation
);
import 'package:random_color/random_color.dart';
RandomColor _randomColor = RandomColor();
Color _color = _randomColor.randomColor(
colorBrightness: ColorBrightness.light
);
If you want to run the tests for this project under Flutter Dart
flutter pub pub run test
의존성 목록 3 개
{"sdk":"flutter"}{"sdk":"flutter"}^1.10.0-nullsafety사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗