neocolor 0.0.0 neocolor: ^0.0.0 copied to clipboard
Color definition, manipulation, conversion, and comparison in fluent Dart.
neocolor #
Color definition, manipulation, conversion, and comparison in fluent Dart.
Purpose #
Provides platform-agnostic (i.e. CLI, Flutter, Web) classes and conventions for
defining (creating or parsing from popular formats), manipulating (changing
elements like brightness, hue, saturation, etc), conversion (from/to popular
formats), and comparison (sometimes called "distance") Color
elements.
Usage #
If you've used Flutter's Color
class, you'll feel at home:
import 'package:neocolor/neocolor.dart';
void main() {
const c1 = Color(0xFF42A5F5);
const c2 = Color.fromARGB(0xFF, 0x42, 0xA5, 0xF5);
print('$c1 == $c2: ${c1 == c2}');
const c3 = Color.fromARGB(255, 66, 165, 245);
const c4 = Color.fromRGBO(66, 165, 245, 1.0);
print('$c3 == $c4: ${c3 == c4}');
// NEW: Use HSB (sometimes called HSV) and HSL to create colors too!
final c5 = Color.fromHSB(207, 73.1, 96.1);
final c6 = Color.fromHSL(207, 89.9, 61.0);
print('$c5 == $c6: ${c5 == c6}');
}
Contributing #
This package welcomes new issues and pull requests.
Changes or requests that do not match the following criteria will be rejected:
- Common decency as described by the Contributor Covenant.
- Making this library brittle/extensible by other libraries.
- Adding platform-specific functionality.
- A somewhat arbitrary bar of "complexity", everything should be easy to use.
Inspiration #
Packages already exist that tackle this problem, often in similar ways:
- Flutter's
dart:ui
package:color
package:dynamic_color
package:eo_color
package:ansicolor
package:rainbow_color
package:tinycolor2
package:pigment
colord
(on NPM)
If one of these packages suits your needs better, use it instead!