Why is the `Brush` a sealed class? I can't customi...
# compose
k
Why is the
Brush
a sealed class? I can't customize it... Any way to hack the compose function to support other color spaces everywhere?
Copy code
internal fun NativePaint.setNativeColor(value: Color) {
    this.color = value.toArgb()
}
r
What’s the issue you are trying to solve exactly? I thought we had fixed Compose forcing colors to sRGB when set on the native paint
k
No, the fix is reverted. I want to use Display P3.
r
Then going down to the android native Canvas is your best solution 😕
k
I need to write some extension functions. But the paint in the DrawContext is private sadly.
r
I meant custom drawing + using native Canvas
You should also definitely file a bug to get this fixed
k
Yes, I can access the native canvas. But I want to create some functions like
drawRect
, drawing on the native canvas requires the native paint. If create paint in the function, the performance will be worse. Compose has reusable paints.
r
You can reuse your own paint