Skip to content

Instantly share code, notes, and snippets.

View devgru's full-sized avatar

Dima Semyushkin devgru

View GitHub Profile
@devgru
devgru / wide-gamut-rendering-guide.md
Created September 9, 2026 09:41
Wide-gamut color solid rendering

Wide-gamut color solid rendering

  • Separate gamut, coordinates, and output encoding. A Display P3 gamut represented in Oklab is still a P3 gamut. Construct each requested gamut independently; never derive sRGB by clipping P3.

  • Use accurate color-space conversions. Keep conversions consistent with the source gamut, white point, and transfer function. A tested library such as culori can provide the math; no particular library is required. Generate a continuous boundary mesh and assign accurate vertex colors. Do not artificially remove chroma near black or white.

  • Choose an explicit output pipeline. For direct WebGPU, use rgba16float for color attachments, MSAA, and resolve; configure the canvas with colorSpace: 'display-p3', alphaMode: 'opaque', and toneMapping: { mode: 'standard' } for SDR color samples.

  • Apply the transfer function exactly once. That canvas expects encoded Display P3 values. Float16 storage does not imply linear encoding. With Three.js or another framework, in

@devgru
devgru / apps.json
Created May 30, 2023 09:48
example karabiner app runner, put into .config/karabiner/assets/complex_modifications/
{
"title": "Run apps",
"rules": [
{
"description": "Run Safari",
"manipulators": [
{
"from": {
"key_code": "left_command",
"modifiers": {
@devgru
devgru / .block
Last active October 23, 2019 20:16 — forked from mbostock/.block
Solar Path
license: gpl-3.0
@devgru
devgru / .block
Created March 27, 2018 13:06 — forked from mbostock/.block
Brush Handles
license: gpl-3.0
@devgru
devgru / .block
Created March 27, 2018 07:44 — forked from mbostock/.block
Gradient Encoding
license: gpl-3.0
@devgru
devgru / .block
Created March 25, 2018 10:02
Pharmacies Viz
license: mit
@devgru
devgru / keybase.md
Created March 22, 2018 11:38
keybase.md

Keybase proof

I hereby claim:

  • I am devgru on github.
  • I am devgru (https://keybase.io/devgru) on keybase.
  • I have a public key whose fingerprint is CAAA 4087 855D AB51 327E 9372 9804 3402 64BA EDD9

To claim this, I am signing this object:

@devgru
devgru / README.md
Last active March 19, 2018 15:49 — forked from veltman/README.md
Centerline label placement

Forked from https://gist.github.com/veltman/403f95aee728d4a043b142c52c113f82

Implementing a variation of Joachim Ungar's curved label placement method described here. The basic process is:

  1. Turn the shape into a polygon of evenly-spaced points.
  2. Generate a Voronoi diagram of those points.
  3. Clip the edges.
  4. Turn the edges into a graph.
  5. Find the "longest shortest path" between any pair of perimeter nodes.
  6. Smooth/simplify that path a bit.
@devgru
devgru / .block
Created January 19, 2018 11:28
Solar Analemmas (local)
license: gpl-3.0
height: 960
@devgru
devgru / .block
Created June 22, 2017 10:38
Sankey Diagram
border: no
license: gpl-3.0