Skip to content

Contrast setting seems like not accurate. #105

@JayronKhong

Description

@JayronKhong

instead of this:

 factory ColorOption.contrast(double contrast) {
    final m = List<double>.from(defaultColorMatrix);
    m[0] = contrast;
    m[6] = contrast;
    m[12] = contrast;
    return ColorOption(matrix: m);
  }

should change to this:

  factory ColorOption.contrast(double contrast) {
    final m = List<double>.from(defaultColorMatrix);
    m[0] = contrast;
    m[6] = contrast;
    m[12] = contrast;
    m[4] = (1.0 - (1 + contrast)) / 2.0 * 255;
    m[9] = (1.0 - (1 + contrast)) / 2.0 * 255;
    m[14] = (1.0 - (1 + contrast)) / 2.0 * 255;
    return ColorOption(matrix: m);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions