Functions for manipulating colors such as changing the format, generating random colors, or calculating contrast. π
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.
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
- 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).
- The function returns the manipulated color in hexadecimal format.
- 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
- Facebook : Oned Ionys
- Instagram : @onedionys
- Twitter : @onedionys
- LinkedIn : @onedionys
- Copyright Β© 2024 One Dionys
- One Dionys - Color Manipulation is an open source project licensed under the MIT license
Love One Dionys - Color Manipulation? Support this project by donating or sharing with others in need.
Made with β€οΈ One Dionys