-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: adds yellowish option * fix: fix scan using canvas yellowish effect --------- Co-authored-by: rwv <[email protected]>
- Loading branch information
Showing
8 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/components/scan-settings/settings/YellowishSetting.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<n-form-item :label="t('settings.yellowish')" :show-feedback="false"> | ||
<template #label> | ||
<span :style="style" class="white-variance-label"> | ||
{{ t('settings.yellowish') }} | ||
</span> | ||
</template> | ||
<n-slider v-model:value="yellowish" :max="2" :min="0" :step="0.01" /> | ||
</n-form-item> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed } from 'vue' | ||
import { NFormItem, NSlider } from 'naive-ui' | ||
import { useI18n } from 'vue-i18n' | ||
import { useVModel } from '@vueuse/core' | ||
const { t } = useI18n() | ||
type yellowishType = number | ||
const props = defineProps<{ | ||
yellowish: yellowishType | ||
}>() | ||
const emit = defineEmits<{ | ||
(e: 'update:yellowish', value: yellowishType): void | ||
}>() | ||
const yellowish = useVModel(props, 'yellowish', emit) | ||
const style = computed(() => { | ||
const value = Math.max(0, Math.min(1, yellowish.value)) | ||
const [r, g, b] = [255, 255, 255].map((start, i) => | ||
Math.round(start + ([252, 242, 199][i] - start) * value) | ||
) | ||
return { | ||
color: `rgb(${r}, ${g}, ${b})` | ||
} | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
.white-variance-label { | ||
transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters