Skip to content

Instantly share code, notes, and snippets.

View RenatoSTV's full-sized avatar

Renato ST RenatoSTV

View GitHub Profile
@akbarjondev
akbarjondev / useImageToBase64.ts
Last active October 28, 2023 11:21
Hook for converting small images or thumbnails into binary data. Converting images in this way gives good experience while loading images in Next.js apps
import { useEffect } from 'react'
export function useImageToBase64(
src: string,
callback: (res: string) => void,
outputFormat?: string
) {
useEffect(() => {
let img = new Image() // Image constructor equivalent to document.createElement
img.crossOrigin = 'Anonymous'
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
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