ランダムに色を変える

  1. Workspace に Part を1つ追加します。
  2. Part に Script を追加します。

0.1秒ごとに、様々な色に変化します。

while true do
    script.Parent.BrickColor = BrickColor.random()
    wait(0.1)
end

様々な色の指定法

BrickColor の new では、RBG で指定する以外に、下記の表の Name や Number で指定する方法があります。なじみのある0から255のRGB で指定したい場合は、Color の方で指定でき、Color3.fromRGB を使用します。
下記の3つのコードは、どれも同じ色になります。

-- Numberでの指定方法
workspace.Part.BrickColor = BrickColor.new(11)
-- Nameでの指定方法
workspace.Part.BrickColor = BrickColor.new("Pastel Blue")
-- 0~255のRGBでの指定方法
workspace.Part.Color = Color3.fromRGB (128, 187, 219)
Color Name Number RGB Value
White 1 [242, 243, 243]
Grey 2 [161, 165, 162]
Light yellow 3 [249, 233, 153]
Brick yellow 5 [215, 197, 154]
Light green (Mint) 6 [194, 218, 184]
Light reddish violet 9 [232, 186, 200]
Pastel Blue 11 [128, 187, 219]
Light orange brown 12 [203, 132, 66]
Nougat 18 [204, 142, 105]
Bright red 21 [196, 40, 28]
Med. reddish violet 22 [196, 112, 160]
Bright blue 23 [13, 105, 172]
Bright yellow 24 [245, 205, 48]
Earth orange 25 [98, 71, 50]
Black 26 [27, 42, 53]
Dark grey 27 [109, 110, 108]
Dark green 28 [40, 127, 71]
Medium green 29 [161, 196, 140]
Lig. Yellowich orange 36 [243, 207, 155]
Bright green 37 [75, 151, 75]
Dark orange 38 [160, 95, 53]
Light bluish violet 39 [193, 202, 222]
Transparent 40 [236, 236, 236]
Tr. Red 41 [205, 84, 75]
Tr. Lg blue 42 [193, 223, 240]
Tr. Blue 43 [123, 182, 232]
Tr. Yellow 44 [247, 241, 141]
Light blue 45 [180, 210, 228]
Tr. Flu. Reddish orange 47 [217, 133, 108]
Tr. Green 48 [132, 182, 141]
Tr. Flu. Green 49 [248, 241, 132]
Phosph. White 50 [236, 232, 222]
Light red 100 [238, 196, 182]
Medium red 101 [218, 134, 122]
Medium blue 102 [110, 153, 202]
Light grey 103 [199, 193, 183]
Bright violet 104 [107, 50, 124]
Br. yellowish orange 105 [226, 155, 64]
Bright orange 106 [218, 133, 65]
Bright bluish green 107 [0, 143, 156]
Earth yellow 108 [104, 92, 67]
Bright bluish violet 110 [67, 84, 147]
Tr. Brown 111 [191, 183, 177]
Medium bluish violet 112 [104, 116, 172]
Tr. Medi. reddish violet 113 [229, 173, 200]
Med. yellowish green 115 [199, 210, 60]
Med. bluish green 116 [85, 165, 175]
Light bluish green 118 [183, 215, 213]
Br. yellowish green 119 [164, 189, 71]
Lig. yellowish green 120 [217, 228, 167]
Med. yellowish orange 121 [231, 172, 88]
Br. reddish orange 123 [211, 111, 76]
Bright reddish violet 124 [146, 57, 120]
Light orange 125 [234, 184, 146]
Tr. Bright bluish violet 126 [165, 165, 203]
Gold 127 [220, 188, 129]
Dark nougat 128 [174, 122, 89]
Silver 131 [156, 163, 168]
Neon orange 133 [213, 115, 61]
Neon green 134 [216, 221, 86]
Sand blue 135 [116, 134, 157]
Sand violet 136 [135, 124, 144]
Medium orange 137 [224, 152, 100]
Sand yellow 138 [149, 138, 115]
Earth blue 140 [32, 58, 86]
Earth green 141 [39, 70, 45]
Tr. Flu. Blue 143 [207, 226, 247]
Sand blue metallic 145 [121, 136, 161]
Sand violet metallic 146 [149, 142, 163]
Sand yellow metallic 147 [147, 135, 103]
Dark grey metallic 148 [87, 88, 87]
Black metallic 149 [22, 29, 50]
Light grey metallic 150 [171, 173, 172]
Sand green 151 [120, 144, 130]
Sand red 153 [149, 121, 119]
Dark red 154 [123, 46, 47]
Tr. Flu. Yellow 157 [255, 246, 123]
Tr. Flu. Red 158 [225, 164, 194]
Gun metallic 168 [117, 108, 98]
Red flip/flop 176 [151, 105, 91]
Yellow flip/flop 178 [180, 132, 85]
Silver flip/flop 179 [137, 135, 136]
Curry 180 [215, 169, 75]
Fire Yellow 190 [249, 214, 46]
Flame yellowish orange 191 [232, 171, 45]
Reddish brown 192 [105, 64, 40]
Flame reddish orange 193 [207, 96, 36]
Medium stone grey 194 [163, 162, 165]
Royal blue 195 [70, 103, 164]
Dark Royal blue 196 [35, 71, 139]
Bright reddish lilac 198 [142, 66, 133]
Dark stone grey 199 [99, 95, 98]
Lemon metalic 200 [130, 138, 93]
Light stone grey 208 [229, 228, 223]
Dark Curry 209 [176, 142, 68]
Faded green 210 [112, 149, 120]
Turquoise 211 [121, 181, 181]
Light Royal blue 212 [159, 195, 233]
Medium Royal blue 213 [108, 129, 183]
Rust 216 [144, 76, 42]
Brown 217 [124, 92, 70]
Reddish lilac 218 [150, 112, 159]
Lilac 219 [107, 98, 155]
Light lilac 220 [167, 169, 206]
Bright purple 221 [205, 98, 152]
Light purple 222 [228, 173, 200]
Light pink 223 [220, 144, 149]
Light brick yellow 224 [240, 213, 160]
Warm yellowish orange 225 [235, 184, 127]
Cool yellow 226 [253, 234, 141]
Dove blue 232 [125, 187, 221]
Medium lilac 268 [52, 43, 117]
Slime green 301 [80, 109, 84]
Smoky grey 302 [91, 93, 105]
Dark blue 303 [0, 16, 176]
Parsley green 304 [44, 101, 29]
Steel blue 305 [82, 124, 174]
Storm blue 306 [51, 88, 130]
Lapis 307 [16, 42, 220]
Dark indigo 308 [61, 21, 133]
Sea green 309 [52, 142, 64]
Shamrock 310 [91, 154, 76]
Fossil 311 [159, 161, 172]
Mulberry 312 [89, 34, 89]
Forest green 313 [31, 128, 29]
Cadet blue 314 [159, 173, 192]
Electric blue 315 [9, 137, 207]
Eggplant 316 [123, 0, 123]
Moss 317 [124, 156, 107]
Artichoke 318 [138, 171, 133]
Sage green 319 [185, 196, 177]
Ghost grey 320 [202, 203, 209]
Lilac 321 [167, 94, 155]
Plum 322 [123, 47, 123]
Olivine 323 [148, 190, 129]
Laurel green 324 [168, 189, 153]
Quill grey 325 [223, 223, 222]
Crimson 327 [151, 0, 0]
Mint 328 [177, 229, 166]
Baby blue 329 [152, 194, 219]
Carnation pink 330 [255, 152, 220]
Persimmon 331 [255, 89, 89]
Maroon 332 [117, 0, 0]
Gold 333 [239, 184, 56]
Daisy orange 334 [248, 217, 109]
Pearl 335 [231, 231, 236]
Fog 336 [199, 212, 228]
Salmon 337 [255, 148, 148]
Terra Cotta 338 [190, 104, 98]
Cocoa 339 [86, 36, 36]
Wheat 340 [241, 231, 199]
Buttermilk 341 [254, 243, 187]
Mauve 342 [224, 178, 208]
Sunrise 343 [212, 144, 189]
Tawny 344 [150, 85, 85]
Rust 345 [143, 76, 42]
Cashmere 346 [211, 190, 150]
Khaki 347 [226, 220, 188]
Lily white 348 [237, 234, 234]
Seashell 349 [233, 218, 218]
Burgundy 350 [136, 62, 62]
Cork 351 [188, 155, 93]
Burlap 352 [199, 172, 120]
Beige 353 [202, 191, 163]
Oyster 354 [187, 179, 178]
Pine Cone 355 [108, 88, 75]
Fawn brown 356 [160, 132, 79]
Hurricane grey 357 [149, 137, 136]
Cloudy grey 358 [171, 168, 158]
Linen 359 [175, 148, 131]
Copper 360 [150, 103, 102]
Dirt brown 361 [86, 66, 54]
Bronze 362 [126, 104, 63]
Flint 363 [105, 102, 92]
Dark taupe 364 [90, 76, 66]
Burnt Sienna 365 [106, 57, 9]
Institutional white 1001 [248, 248, 248]
Mid gray 1002 [205, 205, 205]
Really black 1003 [17, 17, 17]
Really red 1004 [255, 0, 0]
Deep orange 1005 [255, 176, 0]
Alder 1006 [180, 128, 255]
Dusty Rose 1007 [163, 75, 75]
Olive 1008 [193, 190, 66]
New Yeller 1009 [255, 255, 0]
Really blue 1010 [0, 0, 255]
Navy blue 1011 [0, 32, 96]
Deep blue 1012 [33, 84, 185]
Cyan 1013 [4, 175, 236]
CGA brown 1014 [170, 85, 0]
Magenta 1015 [170, 0, 170]
Pink 1016 [255, 102, 204]
Deep orange 1017 [255, 175, 0]
Teal 1018 [18, 238, 212]
Toothpaste 1019 [0, 255, 255]
Lime green 1020 [0, 255, 0]
Camo 1021 [58, 125, 21]
Grime 1022 [127, 142, 100]
Lavender 1023 [140, 91, 159]
Pastel light blue 1024 [175, 221, 255]
Pastel orange 1025 [255, 201, 201]
Pastel violet 1026 [177, 167, 255]
Pastel blue-green 1027 [159, 243, 233]
Pastel green 1028 [204, 255, 204]
Pastel yellow 1029 [255, 255, 204]
Pastel brown 1030 [255, 204, 153]
Royal purple 1031 [98, 37, 209]
Hot pink 1032 [255, 0, 191]

By schilverberch

ROBLOXでゲームを作ろう! 一緒にプログラミングを学びましょう。

コメントを残す