diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index af41340..1890e3c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,10 @@
-
-
+
-
-
+
+
@@ -164,7 +163,7 @@
-
+
@@ -542,7 +541,15 @@
1719197875189
-
+
+
+ 1719274243788
+
+
+
+ 1719274243788
+
+
@@ -563,7 +570,6 @@
-
@@ -588,7 +594,8 @@
-
+
+
diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx
index 460a9ca..8fbc178 100644
--- a/src/components/Navbar/index.tsx
+++ b/src/components/Navbar/index.tsx
@@ -6,6 +6,7 @@ import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import { Link, useNavigate } from 'react-router-dom';
import githubIcon from '@assets/github-mark.png'; // Adjust the path to your GitHub icon
+import { Stack } from '@mui/material';
const Navbar: React.FC = () => {
const navigate = useNavigate();
@@ -14,46 +15,46 @@ const Navbar: React.FC = () => {
position="static"
style={{ backgroundColor: 'white', color: 'black' }}
>
-
+
navigate('/')}
fontSize={20}
- sx={{ flexGrow: 1, cursor: 'pointer' }}
+ sx={{ cursor: 'pointer' }}
color={'primary'}
>
OmniTools
-
-
-
-
- About Us
-
-
-
-
-
- Star us
-
+
+ Star us
+
+
);
diff --git a/src/components/options/ColorSelector.tsx b/src/components/options/ColorSelector.tsx
index ec49951..64a4f89 100644
--- a/src/components/options/ColorSelector.tsx
+++ b/src/components/options/ColorSelector.tsx
@@ -28,7 +28,11 @@ const ColorSelector: React.FC = ({
return (
-
+
inputRef.current?.click()}>
diff --git a/src/pages/image/png/change-colors-in-png/index.tsx b/src/pages/image/png/change-colors-in-png/index.tsx
index 7b8a6e9..99a406d 100644
--- a/src/pages/image/png/change-colors-in-png/index.tsx
+++ b/src/pages/image/png/change-colors-in-png/index.tsx
@@ -9,10 +9,12 @@ import Typography from '@mui/material/Typography';
import { Formik, useFormikContext } from 'formik';
import ColorSelector from '../../../../components/options/ColorSelector';
import Color from 'color';
+import TextFieldWithDesc from 'components/options/TextFieldWithDesc';
const initialValues = {
fromColor: 'white',
- toColor: 'black'
+ toColor: 'black',
+ similarity: '10'
};
const validationSchema = Yup.object({
// splitSeparator: Yup.string().required('The separator is required')
@@ -23,7 +25,7 @@ export default function ChangeColorsInPng() {
const FormikListenerComponent = ({ input }: { input: File }) => {
const { values } = useFormikContext();
- const { fromColor, toColor } = values;
+ const { fromColor, toColor, similarity } = values;
useEffect(() => {
let fromRgb: [number, number, number];
@@ -95,7 +97,7 @@ export default function ChangeColorsInPng() {
}, 'image/png');
};
- processImage(input, fromRgb, toRgb, 10);
+ processImage(input, fromRgb, toRgb, Number(similarity));
}, [input, fromColor, toColor]);
return null;
@@ -141,6 +143,13 @@ export default function ChangeColorsInPng() {
onChange={(val) => setFieldValue('toColor', val)}
description={'With this color (to color)'}
/>
+ setFieldValue('similarity', val)}
+ description={
+ 'Match this % of similar colors of the from color. For example, 10% white will match white and a little bit of gray.'
+ }
+ />
diff --git a/src/pages/image/png/change-colors-in-png/service.ts b/src/pages/image/png/change-colors-in-png/service.ts
deleted file mode 100644
index e69de29..0000000