有啥方法可以使用 H.S.V 选择表面颜色吗?

Posted

技术标签:

【中文标题】有啥方法可以使用 H.S.V 选择表面颜色吗?【英文标题】:Is there any way I can pick a color of a surface using H.S.V?有什么方法可以使用 H.S.V 选择表面颜色吗? 【发布时间】:2020-09-06 15:11:55 【问题描述】:
if mouse_check_button_pressed(mb_left) && pickMode = true 

    hue = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y ); 
    saturation = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y ); 
    value = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y );

有什么方法可以使用 H.S.V 选择表面颜色? 这是说当你按下鼠标按钮并且pickMode在颜色上时,颜色将是鼠标坐标下的颜色。 pickMode 是通过按“P”来激活的。

有多个页面,因此您可以制作动画,这就是表面是数组的原因。 https://paste.mod.gg/teceguqiva.cs

【问题讨论】:

【参考方案1】:

如果您想从表面像素中获取 HSV,请获取像素颜色,然后对其使用 color_* 函数:

var col = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y );
var hue = color_get_hue(col);
var sat = color_get_saturation(col);
var val = color_get_value(col);

【讨论】:

以上是关于有啥方法可以使用 H.S.V 选择表面颜色吗?的主要内容,如果未能解决你的问题,请参考以下文章