ColorExtractor
Samples background and foreground colors from a composable's rendered bounds.
Strategy:
Background: 8 sample points — 4 corners + 4 edge midpoints. Nodes at the edge of a container have consistent background color there; deduplication returns only distinct candidates, so a solid background yields a single-element list.
Text/foreground: single pixel at the node's geometric center.
Rect coordinates must be root-relative, matching Compose semantics bounds. rootView must be laid out with non-zero dimensions before calling extractColors.
Note: drawToBitmap captures a software copy of the entire view on every call. When sampling multiple nodes, prefer creating the bitmap once externally and calling sampleEdges/sampleCenter directly with the shared Bitmap.
Parameters
View whose rendered pixels should be sampled.