mirror of
https://github.com/cupcakearmy/nix-macos.git
synced 2025-09-05 18:30:39 +00:00
clean repo
This commit is contained in:
21
files/omp/colors/index.js
Normal file
21
files/omp/colors/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import color from '@k-vyn/coloralgorithm'
|
||||
import colors from './colors.json' assert { type: 'json' }
|
||||
import fs from 'fs'
|
||||
import yaml from 'yaml'
|
||||
|
||||
const offset = 10
|
||||
const palette = {}
|
||||
for (const { properties, options } of colors) {
|
||||
const result = color.generate(properties, options)
|
||||
const name = result[0].name
|
||||
for (const color of result[0].colors) {
|
||||
palette[`${name.toLowerCase()}-${color.step * offset}`] = color.hex
|
||||
}
|
||||
}
|
||||
|
||||
const configFile = '../main.omp.yaml'
|
||||
const config = fs.readFileSync(configFile, 'utf8')
|
||||
// config.palette = palette
|
||||
const output = yaml.stringify({ palette })
|
||||
|
||||
fs.writeFileSync(configFile, config.replace(/palette:(.|\s)*$/, output))
|
Reference in New Issue
Block a user