[READ-ONLY] Mirror of https://github.com/probablykasper/color-picker-svelte. Color picker for Svelte color-picker-svelte.kasper.space
color-picker svelte typescript
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix lints

Kasper (Apr 15, 2026, 7:15 PM +0200) e101976e 6233d294

+35 -23
+1 -1
package-lock.json
··· 34 34 "vite": "^8.0.8" 35 35 }, 36 36 "peerDependencies": { 37 - "svelte": "^5.0.0" 37 + "svelte": "^3.0.0 || ^4.0.0 || ^5.0.0" 38 38 } 39 39 }, 40 40 "node_modules/@ctrl/tinycolor": {
+13
src/app.d.ts
··· 1 + // See https://svelte.dev/docs/kit/types#app.d.ts 2 + // for information about these interfaces 3 + declare global { 4 + namespace App { 5 + // interface Error {} 6 + // interface Locals {} 7 + // interface PageData {} 8 + // interface PageState {} 9 + // interface Platform {} 10 + } 11 + } 12 + 13 + export {}
+1 -1
src/lib/AlphaSlider.svelte
··· 1 1 <script lang="ts"> 2 - import type { Color } from '$lib/color' 2 + import { Color } from './color.ts' 3 3 import Slider from './Slider.svelte' 4 4 5 5 export let color: Color
+1 -1
src/lib/ColorArea.svelte
··· 1 1 <script lang="ts"> 2 - import { Color } from '$lib/color' 2 + import { Color } from '$lib/color.ts' 3 3 4 4 export let color: Color 5 5 export let clientHeight = 0
+7 -9
src/lib/ColorInput.svelte
··· 1 1 <script lang="ts"> 2 2 import { TinyColor } from '@ctrl/tinycolor' 3 - import { Color } from './color' 3 + import { Color } from './color.ts' 4 4 import ColorPicker from './ColorPicker.svelte' 5 - import { checkShortcut } from './util' 6 - import { Position } from '$lib' 5 + import { checkShortcut } from './util.ts' 6 + import { Position } from '$lib/index.ts' 7 7 8 8 export let color: Color 9 9 export let title = 'Color' ··· 17 17 export let onClose = () => { 18 18 /* noop */ 19 19 } 20 - let skipCloseEvent = !isOpen 21 - $: if (!isOpen) { 22 - if (!skipCloseEvent) { 23 - onClose() 24 - } 25 - skipCloseEvent = false 20 + let wasOpened = false 21 + $: wasOpened = isOpen || wasOpened 22 + $: if (!isOpen && wasOpened) { 23 + onClose() 26 24 } 27 25 28 26 let classes = ''
+2 -2
src/lib/ColorPicker.svelte
··· 1 1 <script lang="ts"> 2 - import type { Color } from './color' 2 + import type { Color } from './color.ts' 3 3 import ColorArea from './ColorArea.svelte' 4 4 import HueSlider from './HueSlider.svelte' 5 5 import AlphaSlider from './AlphaSlider.svelte' 6 - import { Position, shouldShowAbove } from '$lib' 6 + import { Position, shouldShowAbove } from '$lib/index.ts' 7 7 8 8 export let color: Color 9 9 export let isOpen = false
+1 -1
src/lib/HueSlider.svelte
··· 1 1 <script lang="ts"> 2 - import type { Color } from '$lib/color' 2 + import type { Color } from '$lib/color.ts' 3 3 import Slider from './Slider.svelte' 4 4 5 5 export let color: Color
+2 -2
src/lib/Slider.svelte
··· 1 1 <script lang="ts"> 2 - import type { Color } from './color' 3 - import { clamp } from './util' 2 + import type { Color } from './color.ts' 3 + import { clamp } from './util.ts' 4 4 5 5 export let value: number 6 6 export let max: number
+1 -1
src/lib/color.ts
··· 1 1 import { TinyColor } from '@ctrl/tinycolor' 2 - import { clamp } from './util' 2 + import { clamp } from './util.ts' 3 3 4 4 type Hsv = { 5 5 h: number
+1 -1
src/lib/index.ts
··· 6 6 export { default as ColorArea } from './ColorArea.svelte' 7 7 export { default as Slider } from './Slider.svelte' 8 8 9 - export { Color } from './color' 9 + export { Color } from './color.ts' 10 10 11 11 export const enum Position { 12 12 Auto,
+2 -2
src/routes/+page.svelte
··· 1 1 <script lang="ts"> 2 - import { Position } from '$lib' 3 - import { Color } from '$lib/color' 2 + import { Position } from '$lib/index.ts' 3 + import { Color } from '$lib/color.ts' 4 4 import ColorInput from '$lib/ColorInput.svelte' 5 5 import { TinyColor } from '@ctrl/tinycolor' 6 6
+2 -1
src/routes/404/+page.svelte
··· 1 1 <script lang="ts"> 2 2 import { onMount } from 'svelte' 3 3 import { goto } from '$app/navigation' 4 + import { resolve } from '$app/paths' 4 5 onMount(() => { 5 - goto('/') 6 + goto(resolve('/')) 6 7 }) 7 8 </script>
+1 -1
tsconfig.json
··· 1 1 { 2 2 "extends": "./.svelte-kit/tsconfig.json", 3 3 "compilerOptions": { 4 - "rewriteRelativeImportExtensions": true, 4 + "allowImportingTsExtensions": true, 5 5 "allowJs": true, 6 6 "checkJs": true, 7 7 "forceConsistentCasingInFileNames": true,