Sun icon

A free pencil-style sun icon, drawn by code from 1 circle and 8 lines. Use it as an SVG, a React component, or by name. MIT licensed.

sun

01Use it

Use sun

One package, four ways in. The icon inherits currentColor and is decorative unless you give it a title. Install it with npm i @matita/icons.

React

import { Sun } from '@matita/icons/react';

<Sun size={24} />

// or by name
import { SketchIcon } from '@matita/icons/react';
<SketchIcon name="sun" />

JavaScript

import { Sun, toSvg } from '@matita/icons';

toSvg(Sun, { size: 24 });   // SVG string

SVG

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" overflow="visible" class="sketch-icon sketch-icon-sun" data-sketch="" aria-hidden="true"><path d="M10.84 15.89C10.61 15.75 9.91 15.43 9.5 15.09C9.08 14.75 8.61 14.35 8.36 13.86C8.11 13.37 8 12.71 7.99 12.14C7.97 11.56 8.08 10.94 8.27 10.4C8.46 9.86 8.76 9.32 9.13 8.89C9.49 8.47 9.98 8.09 10.47 7.84C10.97 7.6 11.58 7.39 12.13 7.4C12.67 7.42 13.26 7.68 13.76 7.94C14.26 8.21 14.75 8.56 15.15 8.99C15.54 9.42 15.93 9.97 16.13 10.54C16.32 11.11 16.34 11.8 16.31 12.43C16.27 13.06 16.19 13.75 15.94 14.32C15.68 14.88 15.24 15.44 14.77 15.82C14.3 16.2 13.7 16.41 13.12 16.6C12.53 16.79 11.88 17.04 11.29 16.96C10.7 16.89 10.08 16.51 9.57 16.14C9.06 15.78 8.46 15 8.24 14.77" stroke-width="1.68"/><path d="M11.94 2.54Q12.02 4.29 12.14 6.04" stroke-width="1.584"/><path d="M11.89 18.28Q11.91 19.79 11.89 21.3" stroke-width="1.744"/><path d="M2.32 11.94Q3.94 12.04 5.57 11.98" stroke-width="1.68"/><path d="M18.04 12.15Q19.75 12.05 21.47 11.8" stroke-width="1.76"/><path d="M5.22 5.26Q6.51 6.56 7.84 7.82" stroke-width="1.648"/><path d="M16.49 7.77Q17.66 6.64 18.72 5.4" stroke-width="1.664"/><path d="M5.34 18.75Q6.47 17.41 7.58 16.06" stroke-width="1.44"/><path d="M16.33 16.5Q17.6 17.44 18.75 18.51" stroke-width="1.808"/></svg>

Pencil variant

import '@matita/icons/pencil.css';
import { Sun } from '@matita/icons/react';

<Sun size={32} pencil />

The file is icons/sun.svg in the package (pencil/sun.svg for the pencil variant). Matita 0.2.1.

02How it's drawn

The recipe for sun

Sun is not stored as a drawing. It is a recipe of 1 circle and 8 lines on a 24 by 24 grid, and a small program draws it like a pencil would. The wobble comes from the name, so it always comes out the same.

A · Recipe
C 12 12 4;
L 12 3 12 5.5;
L 12 18.5 12 21;
L 3 12 5.5 12;
L 18.5 12 21 12;
L 5.6 5.6 7.4 7.4;
L 16.6 7.4 18.4 5.6;
L 5.6 18.4 7.4 16.6;
L 16.6 16.6 18.4 18.4
B · Plotted
C · Drawn
How it works

03Takes, sizes, pencil

Same icon, every way

Pass a seed for another take of the same recipe. The wobble is capped, so it still reads at 16 px.

seed 0
seed 1
seed 2
seed 3
seed 4

Five seeds of sun. Seed 0 is the default.

16 px
20 px
24 px
32 px
48 px
96 px

True pixel sizes.

Ink
Pencil