flutter_color_analyzer 0.1.1 copy "flutter_color_analyzer: ^0.1.1" to clipboard
flutter_color_analyzer: ^0.1.1 copied to clipboard

Analyze perceptual differences between colors in order to choose optimal color palettes in an accessible way.

flutter_color_analyzer #

Build Status codecov pub points

flutter_color_analyzer offers utilities for analyzing perceptual differences between colors in order to choose optimal color palettes in an accessible way.

Examples #

ColorAnalyzer.noticeablyDifferent #

Based on [1] determine if two colors are noticeably different or not. By default use a model that empirically matches results for 50% of observers noticing a different for color patches with a visual angle of 0.1 degrees (around 0.05cm size viewed from 30cm distance).

import 'package:flutter/material.dart';
import 'package:flutter_color_analyzer/big_color.dart';

void main() {
    final lightBlueAccent = BigColor.fromColor(Colors.lightBlueAccent);
    final lightBlue = BigColor.fromColor(Colors.lightBlue);
    final areNoticeablyDifferent = ColorAnalyzer.noticeablyDifferent(lightBlueAccent, lightBlue);

    // areNoticeablyDifferent is false, because based on the model 50% of observers do not
    // notice a different between lightBlueAccent and lightBlue with a visual angle of 0.1
    // degrees
}

References #

  1. Stone, Maureen C., Danielle Albers Szafir and Vidya Setlur. “An Engineering Model for Color Difference as a Function of Size.” (2014).
3
likes
85
points
24
downloads

Publisher

verified publisherihsan.io

Weekly Downloads

Analyze perceptual differences between colors in order to choose optimal color palettes in an accessible way.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_color_analyzer