You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Adobe Illustrator中制作CIELAB色彩空间a*b*轮(RGB近似版)

制作CIELAB ab轮的RGB近似版本解决方案

核心原理

要实现符合需求的锥形渐变,需基于极坐标系统构建:以中性灰(128,128,128)为中心,沿角度分布指定的四个轴颜色,从中心到边缘实现从灰到纯色彩的饱和度渐变,同时平滑过渡色相。

Adobe Illustrator 精确实现步骤

  1. 创建基础画布:绘制正圆形,标记中心为原点,确保画布为正圆避免渐变变形。
  2. 配置极坐标渐变:
    • 选择圆形对象,打开「渐变」面板,切换为极坐标渐变(中心向外)。
    • 设置中心色标为(128,128,128)。
    • 添加四个色标,分别设置角度为0°(右轴,红色(255,0,0))、90°(上轴,黄色(255,255,0))、180°(左轴,绿色(0,255,0))、270°(下轴,蓝色(0,0,255))。
    • 将所有边缘色标拖拽至圆形边界,确保渐变范围完全匹配画布。
  3. 修正渐变偏差:此前自由渐变偏方形是因为手动控制点的非极坐标分布,改用上述精确角度色标后,渐变会自然呈现锥形(极坐标)分布,无需手动调整自由渐变控制点。
  4. 验证过渡效果:检查45°、135°、225°、315°位置的色相过渡,确保红→黄→绿→蓝→红的平滑衔接,且中心到边缘的饱和度渐变均匀。

代码生成精确版本(Python)

若需要完全精准的渐变,可通过代码生成,避免软件工具的近似误差:

import numpy as np
from PIL import Image

# 设置画布尺寸
size = 500
center = size // 2
radius = center

# 创建空白RGB画布
img = np.zeros((size, size, 3), dtype=np.uint8)

for y in range(size):
    for x in range(size):
        # 计算相对中心的坐标
        dx = x - center
        dy = y - center
        # 转换为极坐标角度(0到2π)和归一化距离(0到1)
        angle = np.arctan2(dy, dx)
        angle = angle + 2 * np.pi if angle < 0 else angle
        distance = np.sqrt(dx**2 + dy**2) / radius
        distance = min(distance, 1.0)  # 限制最大距离为1
        
        # 根据角度确定基础色相
        if 0 <= angle < np.pi/2:
            # 红→黄过渡
            ratio = angle / (np.pi/2)
            r, g, b = 255, int(255 * ratio), 0
        elif np.pi/2 <= angle < np.pi:
            # 黄→绿过渡
            ratio = (angle - np.pi/2) / (np.pi/2)
            r, g, b = int(255 * (1 - ratio)), 255, 0
        elif np.pi <= angle < 3*np.pi/2:
            # 绿→蓝过渡
            ratio = (angle - np.pi) / (np.pi/2)
            r, g, b = 0, int(255 * (1 - ratio)), int(255 * ratio)
        else:
            # 蓝→红过渡
            ratio = (angle - 3*np.pi/2) / (np.pi/2)
            r, g, b = int(255 * ratio), 0, int(255 * (1 - ratio))
        
        # 混合中性灰,实现中心到边缘的饱和度渐变
        gray = 128
        r = int(gray * (1 - distance) + r * distance)
        g = int(gray * (1 - distance) + g * distance)
        b = int(gray * (1 - distance) + b * distance)
        
        img[y, x] = (r, g, b)

# 保存生成的色彩轮
Image.fromarray(img).save("cielab_ab_rgb_wheel.png")

运行代码后会生成完全符合需求的锥形渐变色彩轮,中心为中性灰,边缘色彩纯净,色相过渡平滑。

内容的提问来源于stack exchange,提问作者Joseph Romo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 14:45:39