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

outdated

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

example/README.md

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
0
pub points
23%
popularity

Publisher

verified publisherihsan.io

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_color_analyzer