interpolate-lab gives the same result as RGB interpolate (rgb2xyz/xyz2rgb scale 0-1 channels by 255)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu trong src/style-spec/util/color_spaces.ts và theo dõi luồng các giá trị kênh của Color qua rgb2xyz và xyz2rgb; issue cho biết phép chuyển đổi áp dụng hệ số tỷ lệ 255 không cần thiết. Kiểm tra các fixture không gian màu được nhắc đến trong issue và cập nhật những fixture phản ánh đầu ra hiện tại. Hoàn tất khi repro tạo ra các giá trị Lab và HCL mong đợi mà không có kênh âm.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
mapbox-gl-js version
style-spec only: @mapbox/mapbox-gl-style-spec 14.34.2 (same code on main 1f3879d)
Browser and version
Not browser specific (Node v26.13.0)
Expected behavior
interpolate-lab and interpolate-hcl interpolate in CIELAB/HCL. For the repro below, MapLibre's style spec (26.5.1, which fixed the same code in maplibre/maplibre-style-spec#94) gives:
lab black->white: [ 0.4663, 0.4663, 0.4663, 1 ]
lab red->blue: [ 0.7568, 0, 0.534, 1 ]
hcl red->blue: [ 0.9606, 0, 0.5259, 1 ]
(d3-interpolate gives the same values to 8-bit precision.)
Actual behavior
lab black->white: [ 0.5, 0.5, 0.5, 1 ]
rgb black->white: [ 0.5, 0.5, 0.5, 1 ]
lab red->blue: [ 0.5, 0, 0.5, 1 ]
hcl red->blue: [ 0.7783, -0.0837, 0.5091, 1 ]
interpolate-lab is identical to interpolate, and interpolate-hcl produces a negative channel (#10054).
Link to the demonstration
Not applicable: reproduced with the style-spec package in Node.
Steps to trigger the unexpected behavior
const { expression } = require("@mapbox/mapbox-gl-style-spec");
const spec = { type: "color", "property-type": "data-driven", expression: { interpolated: true, parameters: ["zoom", "feature"] } };
const ev = (e) => {
const c = expression.createExpression(e, spec).value.evaluate({ zoom: 0 }, { properties: {} });
return [c.r, c.g, c.b, c.a].map((v) => +v.toFixed(4));
};
console.log("lab black->white:", ev(["interpolate-lab", ["linear"], 0.5, 0, "black", 1, "white"]));
console.log("rgb black->white:", ev(["interpolate", ["linear"], 0.5, 0, "black", 1, "white"]));
console.log("lab red->blue:", ev(["interpolate-lab", ["linear"], 0.5, 0, "red", 1, "blue"]));
console.log("hcl red->blue:", ev(["interpolate-hcl", ["linear"], 0.5, 0, "red", 1, "blue"]));
src/style-spec/util/color_spaces.ts has x /= 255 in rgb2xyz and 255 * (...) in xyz2rgb, but Color channels are in [0, 1]. The values therefore always fall in the linear segments of the sRGB and Lab transfer functions. Removing the 255 factor in both places fixes it (fixtures generated with the current code would need updating).
Relevant log output
Nothing beyond the output shown in the steps above.
Credit: https://ucsbplse.github.io/
- Ngôn ngữ chính
- TypeScript
- Star
- 12.5k
- Fork
- 2.4k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mapbox/mapbox-gl-js
-
bug :lady_beetle: performance :zap:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
mapbox/mapbox-gl-js#13752 · 1 bình luận ·
-
TypeError: Cannot read properties of undefined (reading 'get') when a map is removed while a color-theme LUT is decodingCó thể đã có người làm @Piyush495 đã nhận 36 ngày trước. Đang mởauto-triaged bug :lady_beetle:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
mapbox/mapbox-gl-js#13737 · 1 bình luận ·
-
auto-triaged bug :lady_beetle:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mapbox/mapbox-gl-js#13723 · 2 bình luận ·
-
auto-triaged bug :lady_beetle:
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
mapbox/mapbox-gl-js#13717 ·
-
>= v3.21 Symbol layer without feature-state expression crash the mapCó thể đã có người làm @liueric-dev đã nhận 77 ngày trước. Đang mởauto-triaged bug :lady_beetle:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
mapbox/mapbox-gl-js#13714 · 1 reaction ·
Tất cả issue của mapbox/mapbox-gl-js
Issue tương tự
-
Autocomplete still accepts an option after becoming disabledCó thể đã có người làm @Xapollon430 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
reduxjs/react-redux#2416 · 1 bình luận ·