TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/bbplayer-app/BBPlayer/llms.txt
Use this file to discover all available pages before exploring further.
@bbplayer/image-theme-colors package is a native Expo module that extracts color palettes from images using platform-native color extraction algorithms. It provides access to dominant, vibrant, muted, and other color swatches with their recommended text colors.
Installation
This package requires Expo 55+ and is designed to work with Expo’s native module system.
Basic Usage
API Reference
extractThemeColorAsync()
Extracts a color palette from an image source.The image source to extract colors from. Can be:
- A URL string (http/https)
- A local file URI
- An Expo ImageRef from the
expo-imagecomponent - A SharedRef to a native image instance
ExtractedPalette object or null if extraction fails.
Type Definitions
ExtractedPalette
The complete color palette extracted from an image.The width of the analyzed image in pixels
The height of the analyzed image in pixels
The most prominent color in the image
A vibrant, saturated color from the image
A light, vibrant color variant
A dark, vibrant color variant
A muted, less saturated color from the image
A light, muted color variant
A dark, muted color variant
ColorInfo
Detailed information about a specific color swatch.The color as a 6-digit hexadecimal value (e.g.,
"#FF0000")Recommended text color for titles when using this background color (e.g.,
"#FFFFFF")Recommended text color for body text when using this background color (e.g.,
"#000000")The number of pixels in the image that match this color, indicating its prominence
Usage with Expo Image
You can use this package with Expo’s Image component by accessing itsImageRef:
Practical Example
Create dynamic UI based on album artwork:Platform Support
- iOS: Uses native color palette extraction
- Android: Uses native color palette extraction