You can import functions to programmatically generate logos for animations or terminal applications.
Basic ASCII Rendering
Use render for standard outline ASCII art.
import { render } from 'oh-my-logo';
const logo = await render('HELLO WORLD', {
palette: 'sunset',
direction: 'horizontal'
});
console.log(logo);
Filled Block Rendering
Use renderFilled for solid block characters. This supports custom shadow styles via the font option.
import { renderFilled } from 'oh-my-logo';
// Standard filled
await renderFilled('AWESOME', { palette: 'fire' });
// Filled with dotted/shaded effect
await renderFilled('SHADOW', { palette: 'sunset', font: 'shade' });
Custom Colors and TypeScript
Pass an array of CSS colors or hex codes to the palette option.
import { render, RenderOptions, PaletteName } from 'oh-my-logo';
const options: RenderOptions = {
palette: ['#ff0000', '#00ff00', '#0000ff'],
direction: 'diagonal',
font: 'Standard'
};
const customLogo = await render('MY BRAND', options);
console.log(customLogo);
import { render, renderFilled, PALETTES, getPaletteNames } from 'oh-my-logo';
// Basic ASCII art rendering
const logo = await render('HELLO WORLD', {
palette: 'sunset',
direction: 'horizontal'
});
console.log(logo);
// Using custom colors
const customLogo = await render('MY BRAND', {
palette: ['#ff0000', '#00ff00', '#0000ff'],
font: 'Big',
direction: 'diagonal'
});
// Filled block characters
await renderFilled('AWESOME', {
palette: 'fire'
});
// Using custom shadow styles in filled mode
await renderFilled('SHADOW', {
palette: 'sunset',
font: 'shade' // Use dotted/shaded effect
});