Skip to content

Instantly share code, notes, and snippets.

View Davicho-Dev's full-sized avatar
🎯
Focusing

David Gavilanez Davicho-Dev

🎯
Focusing
View GitHub Profile
@marco-souza
marco-souza / fileToBase64.ts
Created July 14, 2020 17:15
Convert File to Base64 in JavaScript/TypeScript
export const toBase64 = (file: File) =>
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
@lopspower
lopspower / README.md
Last active June 7, 2025 20:25
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store