# 颜色 *GameMaker Studio 2* 有一个综合性的函数,能操控绘制在屏幕东西的颜色与透明度(为了混合图片的话请用特殊的 **混合模式**和其他的 GPU 特殊函数 [GPU Control](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/gpu/index.html)).使用这些函数让你能够分别创建颜色并且操控绘制透明度来操控绘制不同的东西。作为这个函数的一部分,有一些常量能够作为基础色使用在这个(或其他的)函数中: | 常量 | 颜色 | 数值 | |---|---|---| | c_aqua | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_aqua.png) | 16776960 | | c_black | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_black.png) | 0 | | c_blue | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_blue.png) | 16711680 | | c_dkgray | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_dkgray.png) | 4210752 | | c_fuchsia | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_fuchsia.png) | 16711935 | | c_gray | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_gray.png) | 8421504 | | c_green | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_green.png) | 32768 | | c_lime | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_lime.png) | 65280 | | c_ltgray | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_ltgray.png) | 12632256 | | c_maroon | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_maroon.png) | 128 | | c_navy | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_navy.png) | 8388608 | | c_olive | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_olive.png) | 32896 | | c_orange | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_orange.png) | 4235519 | | c_purple | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_purple.png) | 8388736 | | c_red | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_red.png) | 255 | | c_silver | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_silver.png) | 12632256 | | c_teal | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_teal.png) | 8421376 | | c_white | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_white.png) | 16777215 | | c_yellow | ![](https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/drawing/colour/images/c_yellow.png) | 65535 | 请注意你也可以用"$"后跟16进制的值来创造颜色,这些值也可以用在颜色函数中来获得色调或者用来混合等等... 这个16进制的数值可以分为三个部分,格式为蓝/绿/红。举个栗子,得到一个紫色,你可以用: ~~~ col = $983c95 ~~~ 98是蓝色的值,3c是绿色的值,95是红色的值。 ## 获得颜色与透明度的值 >以下的函数都可以用来获得你选择的颜色的色彩组成,色度,饱和度,亮度,和其他的属性: > > * [colour_get_blue](colour_get_blue.md) > > * [colour_get_green](colour_get_green.md) > > * [colour_get_red](colour_get_red.md) > > * [colour_get_hue](colour_get_hue.md) > > * [colour_get_saturation](colour_get_saturation.md) > > * [colour_get_value](colour_get_value.md) > > * [draw_getpixel](draw_getpixel.md) > > * [draw_getpixel_ext](draw_getpixel_ext.md) > > * [draw_get_colour](draw_get_colour.md) > > * [draw_get_alpha](draw_get_alpha.md) > > > ## 创造颜色 >这些函数可以用人类不懂的数值来创造颜色: > > * [make_colour_hsv](make_colour_hsv.md) > > * [make_colour_rgb](make_colour_rgb.md) > > * [merge_colour](merge_colour.md) > > > ## 设置颜色与透明度的值 > 下列函数能够设置屏幕绘制中多种不同的选项,包括透明度,颜色,和混合: > > * [draw_clear](draw_clear.md) > > * [draw_clear_alpha](draw_clear_alpha.md) > > * [draw_set_alpha](draw_set_alpha.md) > > * [draw_set_colour](draw_set_colour.md) > >