How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import styles from 'ansi-styles';
    
    styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code
    styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code
    
    styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code
    styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code
    
    styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code
    styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code
    Docs
  • import styles from 'ansi-styles';
    
    console.log(`${styles.green.open}Hello world!${styles.green.close}`);
    
    
    // Color conversion between 256/truecolor
    // NOTE: When converting from truecolor to 256 colors, the original color
    //       may be degraded to fit the new color palette. This means terminals
    //       that do not support 16 million colors will best-match the
    //       original color.
    console.log(`${styles.color.ansi(styles.rgbToAnsi(199, 20, 250))}Hello World${styles.color.close}`)
    console.log(`${styles.color.ansi256(styles.rgbToAnsi256(199, 20, 250))}Hello World${styles.color.close}`)
    console.log(`${styles.color.ansi16m(...styles.hexToRgb('#abcdef'))}Hello World${styles.color.close}`)
    Docs
  • import { createStyles } from "@dash-ui/styles";
    
    export const styles = createStyles({
      // createStyles() uses these themes to create a generic
      // for variable and theme usage in the styles() instance
      themes: {
        light: {
          color: {
            // var(--color-bg)
            bg: "#fafafa",
          },
        },
        dark: {
          color: {
            // var(--color-bg)
            bg: "#1a1a1a",
          },
        },
      },
    });
    
    styles.one(({ color }) => ({
      // Will autocomplete and pass type checking
      backgroundColor: color.bg,
      // "red" is not in our `themes` and this will fail
      // type checking
      color: color.red,
    }));
    
    // Likewise, this will pass typechecking
    styles.theme("dark");
    
    // This will not
    styles.theme("whoami");
    Docs
  • const c = require('ansi-colors');
     
    // disable colors manually
    // disable colors manually
    c.enabled = false;
     
    // or use a library to automatically detect support
    // or use a library to automatically detect support
    c.enabled = require('color-support').hasBasic;
     
    console.log(c.red('I will only be colored red if the terminal supports colors'));
    Docs
  • ansiHTML.setColors({
      reset: ['555', '666'], // FOREGROUND-COLOR or [FOREGROUND-COLOR] or [, BACKGROUND-COLOR] or [FOREGROUND-COLOR, BACKGROUND-COLOR]
    // FOREGROUND-COLOR or [FOREGROUND-COLOR] or [, BACKGROUND-COLOR] or [FOREGROUND-COLOR, BACKGROUND-COLOR]
      black: 'aaa',	// String
    // String
      red: 'bbb',
      green: 'ccc',
      yellow: 'ddd',
      blue: 'eee',
      magenta: 'fff',
      cyan: '999',
      lightgrey: '888',
      darkgrey: '777'
    });
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples