onedionys / onedionys-color-manipulation

Functions for manipulating colors such as changing the format, generating random colors, or calculating contrast.

Home Page:https://www.npmjs.com/package/onedionys-color-manipulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to One Dionys - Color Manipulation! πŸ‘‹

Functions for manipulating colors such as changing the format, generating random colors, or calculating contrast. πŸ’–

πŸ’Ύ Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax

const manipulateColor = require('./src/colorManipulation');

// Lighten a color by 20%
const originalColor = "#0066CC";
const manipulatedColor = manipulateColor(originalColor, 20);
console.log(manipulatedColor); // Output: #3399FF

// Darken a color by 30%
const originalColor2 = "#FFA500";
const manipulatedColor2 = manipulateColor(originalColor2, -30);
console.log(manipulatedColor2); // Output: #804000

Explanation

  • The manipulateColor function takes a color in hexadecimal format and a percentage value to adjust the color brightness. It then adjusts the RGB values of the color accordingly, ensuring that the result remains within the valid range (0-255).

Return Value

  • The function returns the manipulated color in hexadecimal format.

πŸ“† Release Date

  • v1.0.0 : 07 March 2024
  • v1.0.1 : 11 March 2024
  • v4.0.0 : 11 March 2024
  • v4.0.1 : 13 March 2024
  • v4.0.2 : 18 March 2024
  • v5.0.0 : 31 March 2024

πŸ§‘ Author

πŸ“ License

  • Copyright Β© 2024 One Dionys
  • One Dionys - Color Manipulation is an open source project licensed under the MIT license

β˜•οΈ Suppport & Donation

Love One Dionys - Color Manipulation? Support this project by donating or sharing with others in need.

Made with ❀️ One Dionys

About

Functions for manipulating colors such as changing the format, generating random colors, or calculating contrast.

https://www.npmjs.com/package/onedionys-color-manipulation

License:MIT License


Languages

Language:JavaScript 100.0%