Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
Revert "Framework wide color" (#54728)
Browse files Browse the repository at this point in the history
  • Loading branch information
flar authored Aug 23, 2024
1 parent 7094f0a commit e4fac78
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 811 deletions.
11 changes: 1 addition & 10 deletions lib/gpu/lib/src/render_pass.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ base class RenderTarget {
final DepthStencilAttachment? depthStencilAttachment;
}

// TODO(gaaclarke): Refactor this to support wide gamut colors.
int _colorToInt(ui.Color color) {
assert(color.colorSpace == ui.ColorSpace.sRGB);
return ((color.a * 255.0).round() << 24) |
((color.r * 255.0).round() << 16) |
((color.g * 255.0).round() << 8) |
((color.b * 255.0).round() << 0);
}

base class RenderPass extends NativeFieldWrapperClass1 {
/// Creates a new RenderPass.
RenderPass._(CommandBuffer commandBuffer, RenderTarget renderTarget) {
Expand All @@ -114,7 +105,7 @@ base class RenderPass extends NativeFieldWrapperClass1 {
index,
color.loadAction.index,
color.storeAction.index,
_colorToInt(color.clearValue),
color.clearValue.value,
color.texture,
color.resolveTexture);
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/lerp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ double? lerpDouble(num? a, num? b, double t) {
///
/// Same as [lerpDouble] but specialized for non-null `double` type.
double _lerpDouble(double a, double b, double t) {
return a + (b - a) * t;
return a * (1.0 - t) + b * t;
}

/// Linearly interpolate between two integers.
Expand Down
Loading

0 comments on commit e4fac78

Please sign in to comment.