跳到内容
🛠️ToolsShed

配色方案生成器

从基础颜色生成互补色、三角色和相似色方案。

调色板

#4F46E5
#DDE548

关于此工具

色彩方案是根据色彩理论原则选择的和谐色集合,设计用于视觉上相互协调并创建吸引人的构图。无论您是在设计网站、创建图形还是规划室内空间,精心选择的色彩方案都能传达情绪、引导注意力并确保您的设计具有凝聚力。该工具根据既定的色彩关系(补色、三色、类似色等)生成专业的色彩方案,帮助您探索自然和谐的色彩组合。

使用该工具非常简单:使用色选择器选择基础色,或输入其十六进制代码,然后从下拉菜单中选择您首选的配色方案。该工具会立即显示方案中的所有颜色及其十六进制值,您可以点击任何颜色将其代码复制到剪贴板。典型的使用场景包括需要完整UI组件调色板的网页设计、品牌形象创建、数据可视化色彩选择,以及色彩关系创造视觉冲击的艺术或室内设计。

常见问题

代码实现

import colorsys

def hex_to_hsl(hex_color):
    hex_color = hex_color.lstrip('#')
    r, g, b = [int(hex_color[i:i+2], 16)/255 for i in (0,2,4)]
    h, l, s = colorsys.rgb_to_hls(r, g, b)
    return int(h*360), int(s*100), int(l*100)

def hsl_to_hex(h, s, l):
    r, g, b = colorsys.hls_to_rgb(h/360, l/100, s/100)
    return '#{:02x}{:02x}{:02x}'.format(int(r*255), int(g*255), int(b*255))

def complementary(hex_color):
    h, s, l = hex_to_hsl(hex_color)
    return [hex_color, hsl_to_hex((h + 180) % 360, s, l)]

print(complementary('#6366f1'))

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.