Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Bring material color utilities from the [`@material-foundation/material-color-ut

## Motives

Basically, this library is similar as other libraries you can found to build material color, as [The Science of Color & Design](https://m3.material.io/blog/science-of-color-design) has been done by a Google engineer including their [source code](https://github.com/material-foundation/material-color-utilities), but the inexistence of the utility for building material color from an image for React Native especially on Android, iOS (including macOS) is really the main motive why [`material-color-react-native`](https://github.com/RakaDoank/material-color-react-native) was created.
Basically, this library is similar as other libraries you can found to build material color, as [The Science of Color & Design](https://m3.material.io/blog/science-of-color-design) has been done by a Google engineer including their [source code](https://github.com/material-foundation/material-color-utilities), but the inexistence of the utility for building material color from an image for React Native especially on Android, iOS (including macOS) is really the main motive why `material-color-react-native` was created.

Bringing the material color utility from an image is a personal challenge. Previously, I have to use [React Native Skia](https://github.com/Shopify/react-native-skia) on Android app to get a Bitmap from an image, because the original [source code](https://github.com/material-foundation/material-color-utilities) from Material Foundation is using HTML Canvas which is really not a compatible for non Web platform, and using the React Native Skia only for that utility is really an overkill.
Bringing the material color utility from an image is a personal challenge. Previously, I have to use React Native Skia on Android app to get a Bitmap from an image, because the original [source code](https://github.com/material-foundation/material-color-utilities) from Material Foundation is using HTML Canvas which is really not a compatible for non Web platform, and using the React Native Skia only for that utility is really an overkill.

## Compatibility

Expand Down
13 changes: 7 additions & 6 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.9.2",
"@docusaurus/preset-classic": "3.9.2",
"@docusaurus/core": "3.10.0",
"@docusaurus/faster": "^3.10.0",
"@docusaurus/preset-classic": "3.10.0",
"@mdx-js/react": "^3.1.1",
"clsx": "^2.1.1",
"prism-react-renderer": "^2.4.1",
"react": "catalog:",
"react-dom": "catalog:"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.9.2",
"@docusaurus/tsconfig": "3.9.2",
"@docusaurus/types": "3.9.2",
"@docusaurus/module-type-aliases": "3.10.0",
"@docusaurus/tsconfig": "3.10.0",
"@docusaurus/types": "3.10.0",
"docusaurus-plugin-typedoc": "^1.4.2",
"typedoc": "^0.28.18",
"typedoc": "^0.28.19",
"typedoc-plugin-markdown": "^4.11.0"
},
"browserslist": {
Expand Down
3 changes: 0 additions & 3 deletions docusaurus/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"@docusaurus/tsconfig",
"../tsconfig.base.json"
],
"compilerOptions": {
"baseUrl": "."
},
"mdx": {
"checkMdx": true
},
Expand Down
22 changes: 11 additions & 11 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
"web": "npm run start -- --web"
},
"dependencies": {
"expo": "55.0.8",
"expo-build-properties": "55.0.10",
"expo-image": "55.0.6",
"expo-image-picker": "55.0.13",
"expo-router": "55.0.7",
"expo-splash-screen": "55.0.12",
"expo-status-bar": "55.0.4",
"expo-system-ui": "55.0.10",
"expo": "55.0.16",
"expo-build-properties": "55.0.13",
"expo-image": "55.0.9",
"expo-image-picker": "55.0.19",
"expo-router": "55.0.13",
"expo-splash-screen": "55.0.19",
"expo-status-bar": "55.0.5",
"expo-system-ui": "55.0.16",
"react": "catalog:",
"react-dom": "catalog:",
"react-native": "0.83.2",
"react-native-paper": "5.15.0",
"react-native": "0.83.6",
"react-native-paper": "5.15.1",
"react-native-web": "0.21.2",
"react-native-safe-area-context": "5.7.0",
"react-native-screens": "4.24.0"
},
"devDependencies": {
"expo-dev-client": "~55.0.10"
"expo-dev-client": "~55.0.28"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@eslint/compat": "2.0.3",
"@react-native/eslint-config": "0.83.2",
"@react-native/eslint-config": "0.83.6",
"@stylistic/eslint-plugin": "5.10.0",
"@types/node": "^24",
"@types/color": "4.2.1",
Expand All @@ -23,9 +23,9 @@
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-native": "^5.0.0",
"globals": "^17.4.0",
"globals": "^17.5.0",
"package-builder": "workspace:*",
"typescript": "5.9.3",
"typescript-eslint": "8.57.1"
"typescript": "6.0.3",
"typescript-eslint": "8.59.0"
}
}
6 changes: 3 additions & 3 deletions package/apple/Utils/ImageUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ + (void)sourceColorFromImageUri:(NSString *)uri

didCreateDispatch(dispatchBlock);

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), dispatchBlock);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), dispatchBlock);
return;
}

Expand All @@ -45,7 +45,7 @@ + (void)sourceColorFromImageUri:(NSString *)uri
});
return;
}

dispatchBlock = dispatch_block_create(DISPATCH_BLOCK_BARRIER, ^{
UIImage *image = [UIImage imageWithData:data];
NSNumber *color = [self sourceColorFromImage:image maxWidthOrHeight:maxWidthOrHeight];
Expand All @@ -56,7 +56,7 @@ + (void)sourceColorFromImageUri:(NSString *)uri

didCreateDispatch(dispatchBlock);

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), dispatchBlock);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), dispatchBlock);
}];

didCreateTask(task);
Expand Down
9 changes: 7 additions & 2 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "material-color-react-native",
"version": "1.0.5",
"version": "1.0.6",
"description": "Bring material color utilities to React Native app",
"license": "MIT",
"author": "RakaDoank <rakaaudira@gmail.com> (https://github.com/RakaDoank)",
Expand Down Expand Up @@ -54,5 +54,10 @@
"android": {
"javaPackageName": "com.audira.lib.materialcolorreactnative"
}
}
},
"keywords": [
"material-color-utilities",
"react-native",
"material-design"
]
}
Loading
Loading