Compare commits

..

No commits in common. "61b13c8533d3eabffa7b62793de78316b8b993e6" and "ab60e53cac2d6ab3704c8b91138157085ebee9f2" have entirely different histories.

7 changed files with 210 additions and 136 deletions

161
dist/palette.toml vendored
View file

@ -12,78 +12,127 @@ url = https://gaiety.me
[colors.pit] [colors.pit]
name = "Pit" name = "Pit"
l = 10 l = 20
c = 3.5 c = 3
h = 225 h = 350
hex = "#00040B" hex = "#201018"
[colors.depths] [colors.depths]
name = "Depths" name = "Depths"
l = 30 l = 27
c = 3.5 c = 3
h = 225 h = 350
hex = "#19323B" hex = "#322028"
[colors.stope] [colors.stope]
name = "Stope" name = "Stope"
l = 50 l = 34
c = 3.5 c = 3
h = 225 h = 350
hex = "#4E6872" hex = "#44323A"
[colors.text] [colors.text]
name = "Text" name = "Text"
l = 90 l = 92
c = 3.5 c = 3
h = 225 h = 350
hex = "#C6E4F0" hex = "#F5DDE7"
[colors.orange] [colors.dark_red]
name = "Orange" name = "Dark Red"
l = 80 l = 82
c = 14 c = 12
h = 0
hex = "#FFA3C1"
[colors.light_red]
name = "Light Red"
l = 92
c = 12
h = 0
hex = "#FFC3E1"
[colors.dark_orange]
name = "Dark Orange"
l = 82
c = 12
h = 45 h = 45
hex = "#FF9F6F" hex = "#FFAB82"
[colors.teal] [colors.light_orange]
name = "Teal" name = "Light Orange"
l = 80 l = 92
c = 14 c = 12
h = 45
hex = "#FFCBA1"
[colors.dark_yellow]
name = "Dark Yellow"
l = 82
c = 12
h = 90
hex = "#E2C162"
[colors.light_yellow]
name = "Light Yellow"
l = 92
c = 12
h = 90
hex = "#FFE183"
[colors.dark_green]
name = "Dark Green"
l = 82
c = 12
h = 135
hex = "#A2D686"
[colors.light_green]
name = "Light Green"
l = 92
c = 12
h = 135
hex = "#C2F7A5"
[colors.dark_teal]
name = "Dark Teal"
l = 82
c = 12
h = 180 h = 180
hex = "#23DBC1" hex = "#5ADDC7"
[colors.red] [colors.light_teal]
name = "Red" name = "Light Teal"
l = 80 l = 92
c = 7 c = 12
h = 22.5 h = 180
hex = "#E8ADA9" hex = "#7EFFE8"
[colors.yellow] [colors.dark_blue]
name = "Yellow" name = "Dark Blue"
l = 80 l = 82
c = 7 c = 12
h = 56.25 h = 270
hex = "#E1B392" hex = "#A6C0FF"
[colors.green] [colors.light_blue]
name = "Green" name = "Light Blue"
l = 80 l = 92
c = 7 c = 12
h = 157.5 h = 270
hex = "#98CCAC" hex = "#C5E1FF"
[colors.blue] [colors.dark_purple]
name = "Blue" name = "Dark Purple"
l = 80 l = 82
c = 7 c = 12
h = 225 h = 315
hex = "#8CC8E0" hex = "#E2ACFA"
[colors.purple] [colors.light_purple]
name = "Purple" name = "Light Purple"
l = 80 l = 92
c = 7 c = 12
h = 292.5 h = 315
hex = "#BEB6E8" hex = "#FFCCFF"

View file

@ -3,16 +3,9 @@ import { Command } from 'commander'
import previewList from './src/preview/cli-list' import previewList from './src/preview/cli-list'
import previewSnippet from './src/preview/cli-snippet' import previewSnippet from './src/preview/cli-snippet'
import buildTOML from './src/build/toml' import buildTOML from './src/build/toml'
import { nanoseconds } from 'bun';
import { timerToSeconds } from './src/helpers/math';
const program = new Command(); const program = new Command();
async function log(isVerbose: true, file: string, timer: [number, number]) {
const time: string = isVerbose ? ` ${timerToSeconds(timer)} seconds` : ''
console.info(`${file}${time}`)
}
program program
.name('verdigris') .name('verdigris')
.description('Mining up the very best Color Palette') .description('Mining up the very best Color Palette')
@ -37,12 +30,10 @@ program
.description('compile toml and other consumable formats') .description('compile toml and other consumable formats')
.option('-v, --verbose', 'additional logs') .option('-v, --verbose', 'additional logs')
.action(async (options) => { .action(async (options) => {
if (options.verbose) console.info('Building...')
const timer = process.hrtime() const timer = process.hrtime()
await buildTOML()
if (options.verbose) console.info('Building Direct Exports...') console.info(`Built in ${timer[0]} seconds`)
log(options.verbose, await buildTOML(), timer)
if (options.verbose) console.info('Building Ports...')
}); });
program.parse(); program.parse();

View file

@ -7,7 +7,7 @@ import type color from '../helpers/color'
const file = appRoot + '/dist/palette.toml' const file = appRoot + '/dist/palette.toml'
const appendToTOML = async (content: string) => await appendToFile(file, content) const appendToTOML = async (content: string) => await appendToFile(file, content)
export default async function(isVerbose = false): Promise<string> { export default async function(isVerbose = false) {
if (isVerbose) console.info('Removing previous build', file) if (isVerbose) console.info('Removing previous build', file)
await rmFile(file) await rmFile(file)
if (isVerbose) console.info('Ensuring path and file exist', file) if (isVerbose) console.info('Ensuring path and file exist', file)
@ -23,8 +23,6 @@ export default async function(isVerbose = false): Promise<string> {
if (isVerbose) console.info(`${color.name}`, file) if (isVerbose) console.info(`${color.name}`, file)
await appendToTOML(colorTOML(color)) await appendToTOML(colorTOML(color))
} }
return file
} }
function headerTOML(): string { function headerTOML(): string {

View file

@ -4,9 +4,3 @@ export function absDegrees(degrees: number): number {
if (degrees < 0) return absDegrees(degrees * -1) if (degrees < 0) return absDegrees(degrees * -1)
return degrees return degrees
} }
export function timerToSeconds([seconds, nanoseconds]: [number, number]): number {
const digitRounding = 1000000
const toDecimal = 100
return seconds + (Math.round(nanoseconds / digitRounding) / toDecimal)
}

View file

@ -3,27 +3,26 @@ import { absDegrees } from './helpers/math'
// Lightness 0-100 // Lightness 0-100
const lightnessLevels = { const lightnessLevels = {
pit: 10, pit: 20,
depths: 30, depths: 27,
stope: 50, stope: 34,
window: 80, window: 82,
mouth: 90, mouth: 92,
} }
// Chrome 0-32 // Chrome 0-32
const chromaLevels = { const chromaLevels = {
surface: 3.5, surface: 3,
colorSecondary: 7, color: 12,
colorPrimary: 14,
} }
// Degrees 0-360 // Degrees 0-360
const hueLevels = { const hueLevels = {
cave: 225, cave: 350,
orange: 45, orange: 45,
teal: 180, teal: 180,
} }
const hueOffset = 45 / 2 const hueOffset = 45
export const pit = new Color('Pit', { export const pit = new Color('Pit', {
l: lightnessLevels.pit, l: lightnessLevels.pit,
@ -49,46 +48,88 @@ export const text = new Color('Text', {
h: hueLevels.cave, h: hueLevels.cave,
}) })
export const teal = new Color('Teal', { export const darkRed = new Color('Dark Red', {
l: lightnessLevels.window, l: lightnessLevels.window,
c: chromaLevels.colorPrimary, c: chromaLevels.color,
h: hueLevels.teal,
})
export const orange = new Color('Orange', {
l: lightnessLevels.window,
c: chromaLevels.colorPrimary,
h: hueLevels.orange,
})
export const red = new Color('Red', {
l: lightnessLevels.window,
c: chromaLevels.colorSecondary,
h: absDegrees(hueLevels.orange - hueOffset), h: absDegrees(hueLevels.orange - hueOffset),
}) })
export const yellow = new Color('Yellow', { export const lightRed = new Color('Light Red', {
l: lightnessLevels.window, l: lightnessLevels.mouth,
c: chromaLevels.colorSecondary, c: chromaLevels.color,
h: absDegrees(hueLevels.orange + (hueOffset / 2)), h: absDegrees(hueLevels.orange - hueOffset),
}) })
export const green = new Color('Green', { export const darkOrange = new Color('Dark Orange', {
l: lightnessLevels.window, l: lightnessLevels.window,
c: chromaLevels.colorSecondary, c: chromaLevels.color,
h: hueLevels.orange,
})
export const lightOrange = new Color('Light Orange', {
l: lightnessLevels.mouth,
c: chromaLevels.color,
h: hueLevels.orange,
})
export const darkYellow = new Color('Dark Yellow', {
l: lightnessLevels.window,
c: chromaLevels.color,
h: absDegrees(hueLevels.orange + hueOffset),
})
export const LightYellow = new Color('Light Yellow', {
l: lightnessLevels.mouth,
c: chromaLevels.color,
h: absDegrees(hueLevels.orange + hueOffset),
})
export const darkGreen = new Color('Dark Green', {
l: lightnessLevels.window,
c: chromaLevels.color,
h: absDegrees(hueLevels.teal - hueOffset), h: absDegrees(hueLevels.teal - hueOffset),
}) })
export const blue = new Color('Blue', { export const lightGreen = new Color('Light Green', {
l: lightnessLevels.mouth,
c: chromaLevels.color,
h: absDegrees(hueLevels.teal - hueOffset),
})
export const darkTeal = new Color('Dark Teal', {
l: lightnessLevels.window, l: lightnessLevels.window,
c: chromaLevels.colorSecondary, c: chromaLevels.color,
h: hueLevels.teal,
})
export const lightTeal = new Color('Light Teal', {
l: lightnessLevels.mouth,
c: chromaLevels.color,
h: hueLevels.teal,
})
export const darkBlue = new Color('Dark Blue', {
l: lightnessLevels.window,
c: chromaLevels.color,
h: absDegrees(hueLevels.teal + (hueOffset * 2)), h: absDegrees(hueLevels.teal + (hueOffset * 2)),
}) })
export const purple = new Color('Purple', { export const lightBlue = new Color('Light Blue', {
l: lightnessLevels.mouth,
c: chromaLevels.color,
h: absDegrees(hueLevels.teal + (hueOffset * 2)),
})
export const darkPurple = new Color('Dark Purple', {
l: lightnessLevels.window, l: lightnessLevels.window,
c: chromaLevels.colorSecondary, c: chromaLevels.color,
h: absDegrees(hueLevels.teal + (hueOffset * 5)), h: absDegrees(hueLevels.teal + (hueOffset * 3)),
})
export const lightPurple = new Color('Light Purple', {
l: lightnessLevels.mouth,
c: chromaLevels.color,
h: absDegrees(hueLevels.teal + (hueOffset * 3)),
}) })
export default [ export default [
@ -96,11 +137,18 @@ export default [
depths, depths,
stope, stope,
text, text,
orange, darkRed,
teal, lightRed,
red, darkOrange,
yellow, lightOrange,
green, darkYellow,
blue, LightYellow,
purple, darkGreen,
lightGreen,
darkTeal,
lightTeal,
darkBlue,
lightBlue,
darkPurple,
lightPurple,
] ]

View file

@ -1,15 +1,15 @@
import chalk from 'chalk' import chalk from 'chalk'
import { pit, depths, stope, text, teal, orange, purple, blue, green, yellow } from '../palette' import { pit, text, darkTeal, darkOrange, lightOrange, darkPurple, lightPurple, darkBlue, darkGreen, stope } from '../palette'
const bg = chalk.bgHex(pit.toHex()).hex(text.toHex()) const bg = chalk.bgHex(pit.toHex()).hex(text.toHex())
const chalkDefinition = chalk.hex(teal.toHex()) const chalkDefinition = chalk.hex(darkTeal.toHex())
const chalkVariable = chalk.hex(blue.toHex()) const chalkVariable = chalk.hex(darkOrange.toHex())
const chalkAssignments = chalk.hex(green.toHex()) const chalkAssignments = chalk.hex(lightOrange.toHex())
const chalkParenthesis = chalk.hex(stope.toHex()) const chalkParenthesis = chalk.hex(darkPurple.toHex())
const chalkParameter = chalk.hex(orange.toHex()) const chalkParameter = chalk.hex(lightPurple.toHex())
const chalkType = chalk.hex(yellow.toHex()) const chalkType = chalk.hex(darkBlue.toHex())
const chalkReturn = chalk.hex(purple.toHex()) const chalkReturn = chalk.hex(darkGreen.toHex())
const chalkComment = chalk.italic.hex(depths.toHex()) const chalkComment = chalk.italic.hex(stope.toHex())
export default () => { export default () => {
console.log( console.log(
@ -18,7 +18,7 @@ ${chalkDefinition('const')}
${chalkVariable('myFunc')} ${chalkVariable('myFunc')}
${chalkAssignments('=')} ${chalkAssignments('=')}
${chalkParenthesis('\(')} ${chalkParenthesis('\(')}
${chalkParameter('isAwesome?')} ${chalkParameter('isAwesome')}
: :
${chalkType('boolean')} ${chalkType('boolean')}
${chalkParenthesis('\)')} ${chalkParenthesis('\)')}

View file

@ -1,5 +1,5 @@
import { expect, test } from 'bun:test' import { expect, test } from 'bun:test'
import { absDegrees, timerToSeconds } from '../../src/helpers/math' import { absDegrees } from '../../src/helpers/math'
test('degrees: 0 is valid', () => { test('degrees: 0 is valid', () => {
expect( expect(
@ -64,9 +64,3 @@ test('degrees: if < 0 return equivilent degree within 360', () => {
absDegrees(-720) absDegrees(-720)
).toBe(360) ).toBe(360)
}) })
test('timer to seconds returns simple response', () => {
expect(
timerToSeconds([1, 23456789])
).toBe(1.23)
})