NCSColor
A simple Dart package to convert NCS-color to his RGB, HSL, and HEX value and used to convert RGB to HSL and RGB to HEX.
Installation
- Add this to your package's
pubspec.yaml
file:
dependencies:
ncscolor: any
- Get the package using your IDE's GUI or via command line with
$ pub get
- Import the
color.dart
file in your app
import 'package:ncscolor/ncscolor.dart';
Usage
To convert ncs-color to rgb
NCSColor(ncsCode: '2060-R60B').toRgb(); //return {r:164, g:58, b:214}
To convert ncs-color to hsl
NCSColor(ncsCode: '2060-R60B').toHsl(); //return {h:281, s:66%, l:53%}
To convert ncs-color to hex
NCSColor(ncsCode: '2060-R60B').toHex(); //return #a43ad6
To convert rgb to hsl
ColorConvert.rgbToHsl(r: 164,b: 58,g:214); //return {h:281, s:66%, l:53%}
To convert rgb to hex
ColorConvert.rgbToHex(r: 164,b: 58,g:214); //return #a43ad6
Screenshots
To online test (w3schools)
W3Color JavaScript Library The JavaScript library used in the color converter can be downloaded from