complimentary_colors 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

Complimentary Colors Build Status

A Dart package for finding complimentary colors.

Installation #

  1. Add this to your package's pubspec.yaml file:
dependencies:
  complimentary_colors: any
  1. Get the package using your IDE's GUI or via command line with
$ pub get
  1. Import the complimentary_colors.dart file in your app
import 'package:complimentary_colors/complimentary_colors.dart';

Usage #

To get the complimentary color of a hex value

HexColor givenColor = new HexColor("FF0000");
HexColor complimentaryColor = CalculateComplimentaryColor.fromHex(givenColor)

To get the complimentary color of a hsl value

HslColor givenColor = new HslColor(270, 100, 100);
HslColor complimentaryColor = CalculateComplimentaryColor.fromHsl(givenColor)

To get the complimentary color of a rgb value

RgbColor givenColor = new RgbColor(270, 100, 100);
RgbColor complimentaryColor = CalculateComplimentaryColor.fromRgb(givenColor)

0.0.1 #

  • Initial publish with support of hex and hsl colors.

0.0.2 #

  • Added example usage. Formatted code to comply with dartfmt.

0.0.3 #

  • Added support for rgb colors.

0.0.4 #

  • Slightly better documentation.

0.0.5 #

  • Example useage now actually runs in pub.

1.0.0 #

  • Added support for Dart 2.

1.0.1 #

  • Fixed dependency issues.

1.0.2 #

  • Updated dependencies.

example/example.dart

import 'package:color/color.dart';
import 'package:complimentary_colors/complimentary_colors.dart';

main() {
  HexColor givenHexColor = new HexColor("FF0000");
  HslColor givenHslColor = new HslColor(270, 100, 100);
  RgbColor givenRgbColor = new RgbColor(255, 132, 91);

  //Get the complimentary color of "FF0000";
  HexColor complimentaryHexColor =
      CalculateComplimentaryColor.fromHex(givenHexColor);
  print("givenHexColor = $givenHexColor");
  print("complimentaryHexColor = $complimentaryHexColor");

  //Get the complimentary color of Hsl(270, 100, 100);
  HslColor complimentaryHslColor =
      CalculateComplimentaryColor.fromHsl(givenHslColor);
  print("givenHslColor = $givenHslColor");
  print("complimentaryHslColor = $complimentaryHslColor");

  //Get the complimentary color of Rgb(255, 132, 91);
  RgbColor complimentaryRgbColor =
      CalculateComplimentaryColor.fromRgb(givenRgbColor);
  print("givenRgbColor = $givenRgbColor");
  print("complimentaryRgbColor = $complimentaryRgbColor");
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  complimentary_colors: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:complimentary_colors/complimentary_colors.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
17
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Nov 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:complimentary_colors/complimentary_colors.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
color ^2.1.1 2.1.1
Dev dependencies
test ^1.5.3