Skip to content

Instantly share code, notes, and snippets.

View alexgrozav's full-sized avatar

Alex Grozav alexgrozav

View GitHub Profile
@alexgrozav
alexgrozav / 📊 Weekly development breakdown
Last active October 26, 2024 15:33
📊 Weekly development breakdown
Vue.js 4 hrs 50 mins ██████████▌░░░░░░░░░░ 50.0%
TypeScript 3 hrs 57 mins ████████▌░░░░░░░░░░░░ 40.8%
JavaScript 21 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.7%
JSON 12 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.1%
SCSS 10 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.8%
@alexgrozav
alexgrozav / contrastColor.styl
Last active September 24, 2017 19:54
A simple Stylus function for getting the contrasting text color (black or white) based on the background color. Extracted from Inkline framework https://github.com/inkline/inkline.
/**
* Get contrast text color for a background color by calculating the luminance
* of the given input color.
*
* @param color Text background color
* @return Contrasting text color
*/
contrastColor(color)
RGB = {
r: red(color)