https://github.com/flutter-studio/smart-color
A smart color package, All ant design colors are included in the plugin
https://github.com/flutter-studio/smart-color
ant ant-design color flutter smart
Last synced: about 1 year ago
JSON representation
A smart color package, All ant design colors are included in the plugin
- Host: GitHub
- URL: https://github.com/flutter-studio/smart-color
- Owner: flutter-studio
- License: other
- Created: 2018-12-07T08:26:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-28T02:24:22.000Z (over 7 years ago)
- Last Synced: 2025-03-24T23:51:21.759Z (about 1 year ago)
- Topics: ant, ant-design, color, flutter, smart
- Language: Dart
- Homepage:
- Size: 74.2 KB
- Stars: 25
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
English | [简体中文](./README_zh-CN.md)
# smart_color
[](https://pub.dartlang.org/packages/smart_color)
A smart color package, All [ant design colors](https://ant.design/docs/spec/colors-cn) are included in the plugin
## Usage
To use this plugin, add `smart_color` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
## Example
``` dart
// Import package
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter/material.dart';
SmartColor.parse("#ffffff");
SmartColor.parse("white");
SmartColor.parse("rgb(0,0,0)")
SmartColor.parse("rgba(0,0,0,.5)")
SmartColor.antDColor(Color(0xFFf5222d)); //To get the color of ant design, you can get ten different colors from one base color
SmartColor.antDColor(Color(0xFFf5222d)).shade1; //Gets color 1
SmartColor.antDColor(Color(0xFFf5222d)).shade2; //Gets color 2
SmartColor.antDColor(Color(0xFFf5222d)).shade3; //Gets color 3
...
SmartColor.antDColor(Color(0xFFf5222d)).shade6; //Gets color 6, which is the same as the base color
...
//Some common colors are already defined in the library
SmartColor.red;
SmartColor.red.shade1;
SmartColor.green;
SmartColor.green.shade1;
```