Color Manipulation
Color Repo Kim provides a set of powerful color manipulation methods to enhance your color-related tasks. Whether you need to generate complementary colors, create harmonious palettes, or apply various effects, Color Repo Kim has got you covered.
Introduction
Color manipulation involves changing the properties of a color, such as its hue, saturation, and lightness, to achieve specific visual effects. This section introduces you to several color manipulation methods available in color-repo-kim and demonstrates how to use them effectively.
Complementary Color
The getComplementaryColor
method allows you to obtain the complementary color of a given color:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const complementaryColor = manipulateModule.getComplementaryColor(baseColor);
console.log('Base Color:', baseColor);
console.log('Complementary Color:', complementaryColor);
Analogous Colors
Use the getAnalogousColors method to get an array of analogous colors for a given color:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const analogousColors = manipulateModule.getAnalogousColors(baseColor);
console.log('Base Color:', baseColor);
console.log('Analogous Colors:', analogousColors);
Triadic Colors
The getTriadicColors method provides an array of triadic colors for a given color:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const triadicColors = manipulateModule.getTriadicColors(baseColor);
console.log('Base Color:', baseColor);
console.log('Triadic Colors:', triadicColors);
Tetradic Colors
Obtain an array of tetradic colors using the getTetradicColors method:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const tetradicColors = manipulateModule.getTetradicColors(baseColor);
console.log('Base Color:', baseColor);
console.log('Tetradic Colors:', tetradicColors);
Monochromatic Colors
Generate monochromatic colors using the getMonochromaticColors method:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const monochromaticColors = manipulateModule.getMonochromaticColors(baseColor, 5);
console.log('Base Color:', baseColor);
console.log('Monochromatic Colors:', monochromaticColors);
Lighten Color
Lighten a color using the lightenColor method:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const lightenedColor = manipulateModule.lightenColor(baseColor, 20);
console.log('Base Color:', baseColor);
console.log('Lightened Color:', lightenedColor);
Darken Color
Darken a color using the darkenColor method:
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const darkenedColor = manipulateModule.darkenColor(baseColor, 20);
console.log('Base Color:', baseColor);
console.log('Darkened Color:', darkenedColor);
Invert Color
Invert a color using the invertColor method:
Copy code
import { manipulateModule } from 'color-repo-kim'
const baseColor = { r: 255, g: 0, b: 0 };
const invertedColor = manipulateModule.invertColor(baseColor);
console.log('Base Color:', baseColor);
console.log('Inverted Color:', invertedColor);