mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 16:35:39 +00:00
Rename noise folder
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { DataModel, Path, ModelPath } from "@mcschema/core"
|
||||
import { Octicon } from "../components/Octicon"
|
||||
import { Property } from "../state/Property"
|
||||
import { hashString, hexId } from "../Utils"
|
||||
import { hexId, stringToColor } from "../Utils"
|
||||
import { View } from "../views/View"
|
||||
import { NormalNoise } from './math/NormalNoise'
|
||||
import { NormalNoise } from './noise/NormalNoise'
|
||||
import { Preview } from './Preview'
|
||||
|
||||
const LOCAL_STORAGE_BIOME_COLORS = 'biome_colors'
|
||||
@@ -110,7 +110,7 @@ export class BiomeNoisePreview extends Preview {
|
||||
getBiomeColor(biome: string): number[] {
|
||||
const color = this.biomeColors.get()[biome]
|
||||
if (color === undefined) {
|
||||
return this.colorFromBiome(biome)
|
||||
return stringToColor(biome)
|
||||
}
|
||||
return color
|
||||
}
|
||||
@@ -124,9 +124,4 @@ export class BiomeNoisePreview extends Preview {
|
||||
getBiomeHex(biome: string): string {
|
||||
return '#' + this.getBiomeColor(biome).map(e => e.toString(16).padStart(2, '0')).join('')
|
||||
}
|
||||
|
||||
private colorFromBiome(biome: string): number[] {
|
||||
const h = Math.abs(hashString(biome))
|
||||
return [h % 256, (h >> 8) % 256, (h >> 16) % 256]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { DataModel, Path, ModelPath } from "@mcschema/core"
|
||||
import { Preview } from './Preview'
|
||||
import { toggleMenu, View } from '../views/View'
|
||||
import { Octicon } from '../components/Octicon'
|
||||
import { NoiseChunkGenerator } from './NoiseChunkGenerator'
|
||||
import { NoiseChunkGenerator } from './noise/NoiseChunkGenerator'
|
||||
|
||||
export class NoiseSettingsPreview extends Preview {
|
||||
private width: number = 512
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PerlinNoise } from './math/PerlinNoise'
|
||||
import { clampedLerp, hexId, lerp2 } from '../Utils'
|
||||
import { PerlinNoise } from './PerlinNoise'
|
||||
import { clampedLerp, hexId, lerp2 } from '../../Utils'
|
||||
|
||||
export class NoiseChunkGenerator {
|
||||
private minLimitPerlinNoise: PerlinNoise
|
||||
Reference in New Issue
Block a user