Skip to content

Commit f174f0a

Browse files
committed
Merge branch 'main' into next
2 parents f594b57 + 221f6da commit f174f0a

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

packages/layerchart/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,18 @@
448448

449449
- fix(Text): Respect font weight when canvas rendered ([#458](https://github.com/techniq/layerchart/pull/458))
450450

451+
## 1.0.13
452+
453+
### Patch Changes
454+
455+
- fix(Canvas): Fix pointer events (hit canvas) when using Brave browser with fingerprinting protection enabled ([#755](https://github.com/techniq/layerchart/pull/755))
456+
457+
## 1.0.12
458+
459+
### Patch Changes
460+
461+
- fix(Axis): Fix reactivity issue with xRange/yRange in Svelte 5.34+. Fixes #641 ([#643](https://github.com/techniq/layerchart/pull/643))
462+
451463
## 1.0.11
452464

453465
### Patch Changes
@@ -1009,6 +1021,7 @@
10091021
- breaking(Bar|Bars): Replaced `inset: number` prop with `insets: Insets | undefined`. ([#321](https://github.com/techniq/layerchart/pull/321))
10101022

10111023
To migrate from `inset` to `insets` replace `inset = n` with:
1024+
10121025
- `insets = { x: n / 2 }` if `orientation="vertical"`
10131026
- `insets = { y: n / 2 }` if `orientation="horizontal"`
10141027

@@ -2104,6 +2117,7 @@
21042117
```
21052118

21062119
**Additional**
2120+
21072121
- Rename tooltipContext's `top`/`left` to `x`/`y`
21082122
- Add `anchor` prop to align based on corner/edge/center (9 points) of tooltip instead of always top-left corner.
21092123
- Add more tooltip examples

packages/layerchart/src/lib/utils/color.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/** Generator to create a new color on each call */
2-
export function* rgbColorGenerator(step = 500) {
2+
export function* rgbColorGenerator(step = 200) {
33
let nextColor = 0;
44

5-
while (nextColor < 16777216) {
6-
const r = nextColor & 0xff;
7-
const g = (nextColor & 0xff00) >> 8;
8-
const b = (nextColor & 0xff0000) >> 16;
5+
while (nextColor < 1 << 21) {
6+
const r = nextColor & 0x7f;
7+
const g = (nextColor >> 7) & 0x7f;
8+
const b = (nextColor >> 14) & 0x7f;
99

1010
nextColor += step;
11-
yield { r, g, b, a: 255 };
11+
yield { r: r * 2, g: g * 2, b: b * 2, a: 255 };
1212
}
1313

1414
return { r: 0, g: 0, b: 0, a: 255 };
@@ -17,10 +17,13 @@ export function* rgbColorGenerator(step = 500) {
1717
type RGBColor = { r: number; g: number; b: number; a?: number };
1818

1919
export function getColorStr(color: RGBColor) {
20+
const r = color.r & 0xfe;
21+
const g = color.g & 0xfe;
22+
const b = color.b & 0xfe;
2023
if (color.a !== undefined) {
21-
return `rgba(${color.r},${color.g},${color.b},${color.a})`;
24+
return `rgba(${r},${g},${b},${color.a})`;
2225
} else {
23-
return `rgb(${color.r},${color.g},${color.b})`;
26+
return `rgb(${r},${g},${b})`;
2427
}
2528
}
2629

0 commit comments

Comments
 (0)