Skip to content

Commit

Permalink
#14 #88 Add new palette map
Browse files Browse the repository at this point in the history
  • Loading branch information
azurepolarbear committed Jun 2, 2024
1 parent 2ff7598 commit ed960d0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
32 changes: 25 additions & 7 deletions docs/release-notes/v0.6.0-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ declare enum Discriminators {

# New Constants

## `ALL_PALETTE_COLORS`
## Palette Color Maps

### `ALL_PALETTE_COLORS`

```typescript
/**
Expand All @@ -509,7 +511,7 @@ declare enum Discriminators {
declare const ALL_PALETTE_COLORS: StringMap<PaletteColor>;
```

## `BLACK_PALETTE_COLORS`
### `BLACK_PALETTE_COLORS`

```typescript
/**
Expand All @@ -524,7 +526,7 @@ declare const ALL_PALETTE_COLORS: StringMap<PaletteColor>;
declare const BLACK_PALETTE_COLORS: StringMap<PaletteColor>;
```

## `BLUE_PALETTE_COLORS`
### `BLUE_PALETTE_COLORS`

```typescript
/**
Expand All @@ -539,7 +541,7 @@ declare const BLACK_PALETTE_COLORS: StringMap<PaletteColor>;
declare const BLUE_PALETTE_COLORS: StringMap<PaletteColor>;
```

## `GREEN_PALETTE_COLORS`
### `GREEN_PALETTE_COLORS`

```typescript
/**
Expand All @@ -554,7 +556,7 @@ declare const BLUE_PALETTE_COLORS: StringMap<PaletteColor>;
declare const GREEN_PALETTE_COLORS: StringMap<PaletteColor>;
```

## `PINK_PALETTE_COLORS`
### `PINK_PALETTE_COLORS`

```typescript
/**
Expand All @@ -569,7 +571,7 @@ declare const GREEN_PALETTE_COLORS: StringMap<PaletteColor>;
declare const PINK_PALETTE_COLORS: StringMap<PaletteColor>;
```

## `PURPLE_PALETTE_COLORS`
### `PURPLE_PALETTE_COLORS`

```typescript
/**
Expand All @@ -584,7 +586,23 @@ declare const PINK_PALETTE_COLORS: StringMap<PaletteColor>;
declare const PURPLE_PALETTE_COLORS: StringMap<PaletteColor>;
```

## `MISCELLANEOUS_PALETTES`
## New Palette Maps

### `ALL_PALETTES`

```typescript
/**
* A map of palette names to {@link Palette} objects for all palettes.
*
* <a href="https://brittni-and-the-polar-bear.github.io/generative-art-library/palettes/all-palettes.html" target="_blank" rel="noopener noreferrer">See the Palettes</a>
*
* @category Palette Collections
* @category Palettes (All)
*/
declare const ALL_PALETTES: StringMap<Palette>;
```

### `MISCELLANEOUS_PALETTES`

```typescript
/**
Expand Down
10 changes: 6 additions & 4 deletions src/main/color/palette/palettes/miscellaneous/brittni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* See the GNU Affero General Public License for more details.
*/

import {Discriminators} from 'discriminator';
import {Palette} from 'palette';
import {_0437F2, _0FFF4F, _121212, _7A00F5, _FF6BB5} from 'palette-colors';

import {MISCELLANEOUS_PALETTES} from '../palette-maps';
import {ALL_PALETTES, MISCELLANEOUS_PALETTES} from '../palette-maps';

/**
* <!-- Coolors Palette Widget -->
Expand All @@ -33,8 +34,6 @@ import {MISCELLANEOUS_PALETTES} from '../palette-maps';
*
* @category Palettes (All)
* @category Palettes (Miscellaneous)
*
* @source
*/
export const BRITTNI: Palette = {
NAME: 'brittni',
Expand Down Expand Up @@ -63,7 +62,10 @@ export const BRITTNI: Palette = {
'#0FFF4F': ['#000000', '#121212', '#0437F2', '#7A00F5'],
'#7A00F5': ['#FFFFFF', '#0FFF4F'],
'#FF6BB5': ['#000000', '#121212']
}
},

DISCRIMINATOR: Discriminators.PALETTE
};

ALL_PALETTES.setUndefinedKey(BRITTNI.NAME, BRITTNI);
MISCELLANEOUS_PALETTES.setUndefinedKey(BRITTNI.NAME, BRITTNI);
10 changes: 10 additions & 0 deletions src/main/color/palette/palettes/palette-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
import {StringMap} from 'map';
import {Palette} from 'palette';

/**
* A map of palette names to {@link Palette} objects for all palettes.
*
* <a href="https://brittni-and-the-polar-bear.github.io/generative-art-library/palettes/all-palettes.html" target="_blank" rel="noopener noreferrer">See the Palettes</a>
*
* @category Palette Collections
* @category Palettes (All)
*/
export const ALL_PALETTES: StringMap<Palette> = new StringMap<Palette>();

/**
* A map of palette names to {@link Palette} objects for all miscellaneous palettes.
*
Expand Down

0 comments on commit ed960d0

Please sign in to comment.