File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import {
2- type Culori ,
2+ type Okhsl ,
33 clampChroma ,
44 convertHslToRgb ,
55 convertRgbToHsl
@@ -29,7 +29,7 @@ export const rgbToSchemist = (
2929 color : RgbColor
3030) : SchemistColor => {
3131 const culoriRgb = rgbToCulori ( color ) ;
32- const { h} = culoriRgbToOklch ( culoriRgb ) ;
32+ const { h = 0 } = culoriRgbToOklch ( culoriRgb ) ;
3333 const { s, l} = culoriRgbToOkhsl ( culoriRgb ) ;
3434
3535 return {
@@ -46,7 +46,7 @@ export const schemistToRgb = ({
4646 l,
4747 a
4848} : SchemistColor ) : RgbColor => {
49- const hsl : Culori . Okhsl = {
49+ const hsl : Okhsl = {
5050 mode : 'okhsl' ,
5151 h,
5252 s : s / 100 ,
Original file line number Diff line number Diff line change 11import {
2- type Culori ,
2+ type Rgb ,
33 filterDeficiencyDeuter ,
44 filterDeficiencyProt ,
55 filterDeficiencyTrit
66} from 'culori/fn' ;
77import { rgbFromCulori , rgbToCulori } from './culori' ;
88import type { RgbColor } from './types' ;
99
10- const protanomalyFilter = filterDeficiencyProt < Culori . Rgb > ( ) ;
11- const deuteranomalyFilter = filterDeficiencyDeuter < Culori . Rgb > ( ) ;
12- const tritanomalyFilter = filterDeficiencyTrit < Culori . Rgb > ( ) ;
10+ const protanomalyFilter = filterDeficiencyProt ( ) ;
11+ const deuteranomalyFilter = filterDeficiencyDeuter ( ) ;
12+ const tritanomalyFilter = filterDeficiencyTrit ( ) ;
1313
1414export const simulateProtanomaly = ( color : RgbColor ) =>
1515 rgbFromCulori ( protanomalyFilter ( rgbToCulori ( color ) ) ) ;
Original file line number Diff line number Diff line change 33 export let title: string = ' ' ;
44 </script >
55
6- <span class ="sample" style ="background: {color };" {title } / >
6+ <span class ="sample" style ="background: {color };" {title }></ span >
77
88<style >
99 span {
Original file line number Diff line number Diff line change 1111 border-radius : var (--radius );
1212 padding : 1rem ;
1313 background : var (--bg-hard );
14+ color : var (--fg );
1415 font : inherit ;
1516 font-family : var (--font-mono );
1617 resize : none ;
Original file line number Diff line number Diff line change 1515 <table >
1616 <thead >
1717 <tr >
18- <td / >
18+ <td ></ td >
1919 <th >Name</th >
2020 <th >Value</th >
2121 </tr >
Original file line number Diff line number Diff line change 9696 : format === ' hsl'
9797 ? HslColorField
9898 : LchColorField }
99- {id }
99+ id = {id as never }
100100 bind:value
101101 />
102102
Original file line number Diff line number Diff line change 2727
2828<style >
2929 input {
30- -webkit- appearance : none ;
30+ appearance : none ;
3131 width : 100% ;
3232 height : 1rem ;
3333 background : transparent ;
Original file line number Diff line number Diff line change 6868 <div
6969 class =" output"
7070 style ="--output: {formatSchemist ($output [0 ])};"
71- / >
71+ ></ div >
7272
7373 <div class ="self" class:open ={areOptionsOpen }>
7474 <header >
7575 <div class =" title" >
7676 <h3 class =" name" >
7777 <div
7878 role =" textbox"
79+ tabindex =" -1"
7980 contenteditable =" true"
8081 spellcheck =" false"
8182 aria-label =" Design token"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export const debounce = <Fn extends (...args: any) => any>(
44 callback : Fn ,
55 timeout : DebounceTimeout
66) => {
7- let timer : NodeJS . Timeout ;
7+ let timer : number ;
88
99 return ( ...args : Parameters < Fn > ) => {
1010 clearTimeout ( timer ) ;
You can’t perform that action at this time.
0 commit comments