Skip to content

Instantly share code, notes, and snippets.

View lonkly's full-sized avatar
:shipit:

Vivienne Fosh lonkly

:shipit:
View GitHub Profile
@riggaroo
riggaroo / CompositingStrategyOffscreenExample.kt
Last active January 21, 2024 21:29
GraphicsLayer CompositingStrategy Example demonstrating offscreen compositing strategy in Jetpack Compose, leveraging BlendMode.Clear to mask some of the image away.
/* Copyright 2022 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
@Composable
fun GraphicsLayerCompositingStrategyExample() {
Image(painter = painterResource(id = R.drawable.dog),
contentDescription = "Dog",
contentScale = ContentScale.Crop,
modifier = Modifier
.size(120.dp)
.aspectRatio(1f)
@dceddia
dceddia / CGPath+svg.swift
Last active July 19, 2023 14:51
Convert a CGPath to an SVG element with this Swift extension to CGPath
//
// CGPath+svg.swift
//
// Create an SVG element from a CGPath.
//
// Created by Dave Ceddia.
// MIT Licensed
//
// Inspired by: https://github.com/mro/MROGeometry/blob/master/MROGeometry/CGPathWriter.c