Skip to content
/ solid-hex Public

A simple hexagon library using cube-coordinates ⬡

License

Notifications You must be signed in to change notification settings

njlr/solid-hex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solid-hex

A simple hexagon library using cube-coordinates. ⬡

This package is based on code from https://www.redblobgames.com/grids/hexagons/.

Install

yarn add solid-hex

Usage

import * as hex from 'solid-hex';

const a = hex.hex(2, 3);
const b = hex.scale(a, 10);
const c = hex.lerp(a, b, 0.5);

// etc... 

This library is designed to work best with the pipeline operator:

import * as Hex from 'solid-hex';

const a = hex.hex(2, 3)
  |> hex.scale(10)
  |> hex.lerp(hex.hex(1, 2), 0.5))

// etc... 

About

A simple hexagon library using cube-coordinates ⬡

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published