Skip to content

Commit 6a8cd62

Browse files
committed
Fix typo
1 parent 1d74286 commit 6a8cd62

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/p4/ColorPicker.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
import ColorSlider from './ColorSlider.svelte';
3-
import {hexToRGb, rgbToHex, rgbToHsv, hsvToRgb} from './color-utils';
3+
import {hexToRgb, rgbToHex, rgbToHsv, hsvToRgb} from './color-utils';
44
import {_} from '../locales';
55
66
export let value;
@@ -26,7 +26,7 @@
2626
valueAsHsv = hsv;
2727
};
2828
const setHex = (hex) => {
29-
const valueAsRgb = hexToRGb(hex);
29+
const valueAsRgb = hexToRgb(hex);
3030
value = hex;
3131
valueAsHsv = rgbToHsv(...valueAsRgb);
3232
};

src/p4/color-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// - The H, S, V channels of HSV[A] are in [0-1]
44
// - The A channel is always in [0-1]
55

6-
export const hexToRGb = (hex) => {
6+
export const hexToRgb = (hex) => {
77
hex = hex.trim();
88
if (hex.startsWith('#')) {
99
hex = hex.substr(1);

test/p4/color-utils.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import {hexToRGb, rgbToHex, rgbToHsv, hsvToRgb} from '../../src/p4/color-utils';
1+
import {hexToRgb, rgbToHex, rgbToHsv, hsvToRgb} from '../../src/p4/color-utils';
22

3-
test('hexToRGb', () => {
4-
expect(hexToRGb('#000000')).toEqual([0, 0, 0]);
5-
expect(hexToRGb('#fffFFf')).toEqual([255, 255, 255]);
6-
expect(hexToRGb('#abcdef')).toEqual([0xab, 0xcd, 0xef]);
7-
expect(hexToRGb('abcdef')).toEqual([0xab, 0xcd, 0xef]);
8-
expect(hexToRGb(' abcdef ')).toEqual([0xab, 0xcd, 0xef]);
9-
expect(hexToRGb('#fff')).toEqual([255, 255, 255]);
10-
expect(hexToRGb('abc')).toEqual([0xaa, 0xbb, 0xcc]);
3+
test('hexToRgb', () => {
4+
expect(hexToRgb('#000000')).toEqual([0, 0, 0]);
5+
expect(hexToRgb('#fffFFf')).toEqual([255, 255, 255]);
6+
expect(hexToRgb('#abcdef')).toEqual([0xab, 0xcd, 0xef]);
7+
expect(hexToRgb('abcdef')).toEqual([0xab, 0xcd, 0xef]);
8+
expect(hexToRgb(' abcdef ')).toEqual([0xab, 0xcd, 0xef]);
9+
expect(hexToRgb('#fff')).toEqual([255, 255, 255]);
10+
expect(hexToRgb('abc')).toEqual([0xaa, 0xbb, 0xcc]);
1111
});
1212

1313
test('rgbToHex', () => {

0 commit comments

Comments
 (0)