This commit is contained in:
Nathan Bierema 2020-08-14 10:11:16 -04:00
parent 71559d05f8
commit db6c2a2a9b
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import curry from 'lodash.curry'; import curry from 'lodash.curry';
import * as base16 from 'base16'; import * as base16 from 'base16';
import { Base16Theme } from 'base16';
import rgb2hex from 'pure-color/convert/rgb2hex'; import rgb2hex from 'pure-color/convert/rgb2hex';
import parse from 'pure-color/parse'; import parse from 'pure-color/parse';
import flow from 'lodash.flow'; import flow from 'lodash.flow';
@ -148,7 +149,7 @@ const getStylingByKeys = (mergedStyling, keys, ...args) => {
return props; return props;
}; };
export const invertBase16Theme = (base16Theme) => export const invertBase16Theme = (base16Theme: Base16Theme) =>
Object.keys(base16Theme).reduce( Object.keys(base16Theme).reduce(
(t, key) => ( (t, key) => (
(t[key] = /^base/.test(key) (t[key] = /^base/.test(key)

View File

@ -0,0 +1,3 @@
import { Base16Theme } from 'base16';
export type Theme = string | Base16Theme | StylingConfig;

View File

@ -1,5 +1,5 @@
import { createStyling, invertBase16Theme, getBase16Theme } from '../src'; import { createStyling, invertBase16Theme, getBase16Theme } from '../src';
import apathy from 'base16/lib/apathy'; import { apathy } from 'base16';
const base16Theme = { const base16Theme = {
scheme: 'myscheme', scheme: 'myscheme',